Skip to main content
POST
/
project
/
{project_id}
/
chart
/
quick-create
cURL
curl --request POST \
  --url https://api.chartbrew.com/project/{project_id}/chart/quick-create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "project_id": 123,
  "name": "<string>",
  "type": "line",
  "subType": "<string>",
  "public": false,
  "shareable": false,
  "displayLegend": false,
  "pointRadius": 123,
  "dataLabels": false,
  "startDate": "2023-11-07T05:31:56Z",
  "endDate": "2023-11-07T05:31:56Z",
  "dateVarsFormat": "<string>",
  "includeZeros": true,
  "currentEndDate": false,
  "fixedStartDate": false,
  "timeInterval": "day",
  "autoUpdate": 123,
  "draft": true,
  "mode": "chart",
  "maxValue": 123,
  "minValue": 123,
  "disabledExport": true,
  "onReport": true,
  "xLabelTicks": "default",
  "stacked": false,
  "horizontal": false,
  "showGrowth": false,
  "invertGrowth": false,
  "layout": {},
  "isLogarithmic": false,
  "content": "<string>",
  "ranges": {
    "ranges": [
      {
        "min": 123,
        "max": 123,
        "label": "<string>"
      }
    ]
  },
  "dashedLastPoint": false,
  "defaultRowsPerPage": 10,
  "chartDatasetConfigs": [
    {
      "dataset_id": 123,
      "formula": "<string>",
      "datasetColor": "<string>",
      "fillColor": "<string>",
      "fill": false,
      "multiFill": false,
      "legend": "<string>",
      "pointRadius": 123,
      "excludedFields": [
        "<string>"
      ],
      "sort": "asc",
      "columnsOrder": [
        "<string>"
      ],
      "order": 1,
      "maxRecords": 123,
      "goal": 123,
      "configuration": {
        "variables": [
          {
            "name": "<string>",
            "value": "<string>"
          }
        ]
      }
    }
  ]
}'
{
  "id": "<string>",
  "name": "<string>",
  "type": "line",
  "subType": "<string>",
  "chartData": {},
  "chartDataUpdated": "2023-11-07T05:31:56Z",
  "project_id": "<string>",
  "public": true,
  "shareable": true,
  "ChartDatasetConfigs": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "chart_id": 123,
      "dataset_id": 123,
      "formula": "<string>",
      "datasetColor": "<string>",
      "fillColor": "<string>",
      "fill": false,
      "multiFill": false,
      "legend": "<string>",
      "pointRadius": 123,
      "excludedFields": [
        "<string>"
      ],
      "sort": "<string>",
      "columnsOrder": [
        "<string>"
      ],
      "order": 0,
      "maxRecords": 123,
      "goal": 123,
      "configuration": {
        "variables": [
          {
            "name": "<string>",
            "value": "<string>"
          }
        ]
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

project_id
string
required

ID of the project

Body

application/json

Create a chart with all its chart dataset configs in one API call

project_id
integer
required

ID of the project

name
string
required

Name of the chart

type
enum<string>
required

The type of chart

Available options:
line,
bar,
pie,
doughnut,
radar,
polar,
table,
kpi,
avg,
gauge,
matrix,
markdown
subType
string

The sub-type of chart, currently only AddTimeseries is supported for accumulating timeseries data

public
boolean
default:false

Whether the chart is public

shareable
boolean
default:false

Whether the chart is shareable

displayLegend
boolean
default:false

Whether to display the chart.js legend

pointRadius
integer

0 to hide, integer value to set the point radius

dataLabels
boolean
default:false

Whether to display the data labels on each data point on the chart

startDate
string<date-time>

Used to inject a fixed start date into the chart

endDate
string<date-time>

Used to inject a fixed end date into the chart

dateVarsFormat
string

The format of the date variables in the chart

includeZeros
boolean
default:true

Whether to include zero-valued data points in the chart

currentEndDate
boolean
default:false

Whether to use the current end date as the end date for the chart - this moves the start date to match the original period length

fixedStartDate
boolean
default:false

Whether to force the start date to remain fixed

timeInterval
enum<string>
default:day

The time interval of the chart

Available options:
second,
minute,
hour,
day,
week,
month,
year
autoUpdate
integer

The interval in seconds at which the chart should be automatically updated

draft
boolean
default:true

Whether the chart is a draft and should be hidden from dashboard viewers

mode
enum<string>
default:chart

Chart mode shows just the chart, kpichart shows a KPI on top of the chart.

Available options:
chart,
kpichart
maxValue
integer

Cap the maximum shown value on the chart

minValue
integer

Cap the minimum shown value on the chart

disabledExport
boolean

Whether to disable the export button for the chart

onReport
boolean
default:true

Whether to display the chart on the report

xLabelTicks
enum<string>
default:default

How many ticks to display on the x-axis

Available options:
default,
half,
third,
fourth,
showAll
stacked
boolean
default:false

Whether to stack the chart - only works for bar charts

horizontal
boolean
default:false

Whether to display the chart horizontally - only works for bar charts

showGrowth
boolean
default:false

Whether to show the growth percentage at the top of the chart

invertGrowth
boolean
default:false

When negative growth is meant to be positive and vice versa

layout
object

The layout of the chart - in the format of react-grid-layout. If not provided, will be automatically calculated based on existing charts in the project.

isLogarithmic
boolean
default:false

Whether to use a logarithmic scale for the y-axis

content
string

The content used for type=markdown

ranges
object

The ranges to display on the chart - only works for gauge charts

dashedLastPoint
boolean
default:false

Whether to dash the last point on the chart - only works for line charts

defaultRowsPerPage
integer
default:10

Default number of rows per page for table charts

chartDatasetConfigs
object[]

Array of chart dataset configs to create with the chart. The chart_id will be automatically set.

Response

Created chart with all chart dataset configs

id
string
name
string
type
enum<string>
Available options:
line,
bar,
pie,
doughnut,
radar,
polar,
table,
kpi,
avg,
gauge,
matrix,
markdown
subType
string
chartData
object
chartDataUpdated
string<date-time>
project_id
string
public
boolean
shareable
boolean
ChartDatasetConfigs
object[]