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>",
"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,
"xAxis": "<string>",
"xAxisOperation": "<string>",
"yAxis": "<string>",
"dateField": "<string>",
"dateFormat": "<string>",
"conditions": [
{
"id": "<string>",
"field": "<string>",
"value": "<string>",
"displayValues": true
}
],
"formula": "<string>",
"datasetColor": "<string>",
"fillColor": "<string>",
"fill": false,
"multiFill": false,
"legend": "<string>",
"pointRadius": 123,
"excludedFields": [
"<string>"
],
"columnsOrder": [
"<string>"
],
"order": 1,
"maxRecords": 123,
"goal": 123,
"configuration": {
"variables": [
{
"name": "<string>",
"value": "<string>"
}
]
}
}
]
}
'import requests
url = "https://api.chartbrew.com/project/{project_id}/chart/quick-create"
payload = {
"project_id": 123,
"name": "<string>",
"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,
"xAxis": "<string>",
"xAxisOperation": "<string>",
"yAxis": "<string>",
"dateField": "<string>",
"dateFormat": "<string>",
"conditions": [
{
"id": "<string>",
"field": "<string>",
"value": "<string>",
"displayValues": True
}
],
"formula": "<string>",
"datasetColor": "<string>",
"fillColor": "<string>",
"fill": False,
"multiFill": False,
"legend": "<string>",
"pointRadius": 123,
"excludedFields": ["<string>"],
"columnsOrder": ["<string>"],
"order": 1,
"maxRecords": 123,
"goal": 123,
"configuration": { "variables": [
{
"name": "<string>",
"value": "<string>"
}
] }
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project_id: 123,
name: '<string>',
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,
xAxis: '<string>',
xAxisOperation: '<string>',
yAxis: '<string>',
dateField: '<string>',
dateFormat: '<string>',
conditions: [{id: '<string>', field: '<string>', value: '<string>', displayValues: true}],
formula: '<string>',
datasetColor: '<string>',
fillColor: '<string>',
fill: false,
multiFill: false,
legend: '<string>',
pointRadius: 123,
excludedFields: ['<string>'],
columnsOrder: ['<string>'],
order: 1,
maxRecords: 123,
goal: 123,
configuration: {variables: [{name: '<string>', value: '<string>'}]}
}
]
})
};
fetch('https://api.chartbrew.com/project/{project_id}/chart/quick-create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.chartbrew.com/project/{project_id}/chart/quick-create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'project_id' => 123,
'name' => '<string>',
'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,
'xAxis' => '<string>',
'xAxisOperation' => '<string>',
'yAxis' => '<string>',
'dateField' => '<string>',
'dateFormat' => '<string>',
'conditions' => [
[
'id' => '<string>',
'field' => '<string>',
'value' => '<string>',
'displayValues' => true
]
],
'formula' => '<string>',
'datasetColor' => '<string>',
'fillColor' => '<string>',
'fill' => false,
'multiFill' => false,
'legend' => '<string>',
'pointRadius' => 123,
'excludedFields' => [
'<string>'
],
'columnsOrder' => [
'<string>'
],
'order' => 1,
'maxRecords' => 123,
'goal' => 123,
'configuration' => [
'variables' => [
[
'name' => '<string>',
'value' => '<string>'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.chartbrew.com/project/{project_id}/chart/quick-create"
payload := strings.NewReader("{\n \"project_id\": 123,\n \"name\": \"<string>\",\n \"subType\": \"<string>\",\n \"public\": false,\n \"shareable\": false,\n \"displayLegend\": false,\n \"pointRadius\": 123,\n \"dataLabels\": false,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"dateVarsFormat\": \"<string>\",\n \"includeZeros\": true,\n \"currentEndDate\": false,\n \"fixedStartDate\": false,\n \"timeInterval\": \"day\",\n \"autoUpdate\": 123,\n \"draft\": true,\n \"mode\": \"chart\",\n \"maxValue\": 123,\n \"minValue\": 123,\n \"disabledExport\": true,\n \"onReport\": true,\n \"xLabelTicks\": \"default\",\n \"stacked\": false,\n \"horizontal\": false,\n \"showGrowth\": false,\n \"invertGrowth\": false,\n \"layout\": {},\n \"isLogarithmic\": false,\n \"content\": \"<string>\",\n \"ranges\": {\n \"ranges\": [\n {\n \"min\": 123,\n \"max\": 123,\n \"label\": \"<string>\"\n }\n ]\n },\n \"dashedLastPoint\": false,\n \"defaultRowsPerPage\": 10,\n \"chartDatasetConfigs\": [\n {\n \"dataset_id\": 123,\n \"xAxis\": \"<string>\",\n \"xAxisOperation\": \"<string>\",\n \"yAxis\": \"<string>\",\n \"dateField\": \"<string>\",\n \"dateFormat\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"displayValues\": true\n }\n ],\n \"formula\": \"<string>\",\n \"datasetColor\": \"<string>\",\n \"fillColor\": \"<string>\",\n \"fill\": false,\n \"multiFill\": false,\n \"legend\": \"<string>\",\n \"pointRadius\": 123,\n \"excludedFields\": [\n \"<string>\"\n ],\n \"columnsOrder\": [\n \"<string>\"\n ],\n \"order\": 1,\n \"maxRecords\": 123,\n \"goal\": 123,\n \"configuration\": {\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.chartbrew.com/project/{project_id}/chart/quick-create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": 123,\n \"name\": \"<string>\",\n \"subType\": \"<string>\",\n \"public\": false,\n \"shareable\": false,\n \"displayLegend\": false,\n \"pointRadius\": 123,\n \"dataLabels\": false,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"dateVarsFormat\": \"<string>\",\n \"includeZeros\": true,\n \"currentEndDate\": false,\n \"fixedStartDate\": false,\n \"timeInterval\": \"day\",\n \"autoUpdate\": 123,\n \"draft\": true,\n \"mode\": \"chart\",\n \"maxValue\": 123,\n \"minValue\": 123,\n \"disabledExport\": true,\n \"onReport\": true,\n \"xLabelTicks\": \"default\",\n \"stacked\": false,\n \"horizontal\": false,\n \"showGrowth\": false,\n \"invertGrowth\": false,\n \"layout\": {},\n \"isLogarithmic\": false,\n \"content\": \"<string>\",\n \"ranges\": {\n \"ranges\": [\n {\n \"min\": 123,\n \"max\": 123,\n \"label\": \"<string>\"\n }\n ]\n },\n \"dashedLastPoint\": false,\n \"defaultRowsPerPage\": 10,\n \"chartDatasetConfigs\": [\n {\n \"dataset_id\": 123,\n \"xAxis\": \"<string>\",\n \"xAxisOperation\": \"<string>\",\n \"yAxis\": \"<string>\",\n \"dateField\": \"<string>\",\n \"dateFormat\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"displayValues\": true\n }\n ],\n \"formula\": \"<string>\",\n \"datasetColor\": \"<string>\",\n \"fillColor\": \"<string>\",\n \"fill\": false,\n \"multiFill\": false,\n \"legend\": \"<string>\",\n \"pointRadius\": 123,\n \"excludedFields\": [\n \"<string>\"\n ],\n \"columnsOrder\": [\n \"<string>\"\n ],\n \"order\": 1,\n \"maxRecords\": 123,\n \"goal\": 123,\n \"configuration\": {\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chartbrew.com/project/{project_id}/chart/quick-create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": 123,\n \"name\": \"<string>\",\n \"subType\": \"<string>\",\n \"public\": false,\n \"shareable\": false,\n \"displayLegend\": false,\n \"pointRadius\": 123,\n \"dataLabels\": false,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"dateVarsFormat\": \"<string>\",\n \"includeZeros\": true,\n \"currentEndDate\": false,\n \"fixedStartDate\": false,\n \"timeInterval\": \"day\",\n \"autoUpdate\": 123,\n \"draft\": true,\n \"mode\": \"chart\",\n \"maxValue\": 123,\n \"minValue\": 123,\n \"disabledExport\": true,\n \"onReport\": true,\n \"xLabelTicks\": \"default\",\n \"stacked\": false,\n \"horizontal\": false,\n \"showGrowth\": false,\n \"invertGrowth\": false,\n \"layout\": {},\n \"isLogarithmic\": false,\n \"content\": \"<string>\",\n \"ranges\": {\n \"ranges\": [\n {\n \"min\": 123,\n \"max\": 123,\n \"label\": \"<string>\"\n }\n ]\n },\n \"dashedLastPoint\": false,\n \"defaultRowsPerPage\": 10,\n \"chartDatasetConfigs\": [\n {\n \"dataset_id\": 123,\n \"xAxis\": \"<string>\",\n \"xAxisOperation\": \"<string>\",\n \"yAxis\": \"<string>\",\n \"dateField\": \"<string>\",\n \"dateFormat\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"displayValues\": true\n }\n ],\n \"formula\": \"<string>\",\n \"datasetColor\": \"<string>\",\n \"fillColor\": \"<string>\",\n \"fill\": false,\n \"multiFill\": false,\n \"legend\": \"<string>\",\n \"pointRadius\": 123,\n \"excludedFields\": [\n \"<string>\"\n ],\n \"columnsOrder\": [\n \"<string>\"\n ],\n \"order\": 1,\n \"maxRecords\": 123,\n \"goal\": 123,\n \"configuration\": {\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"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,
"xAxis": "<string>",
"xAxisOperation": "<string>",
"yAxis": "<string>",
"yAxisOperation": "<string>",
"dateField": "<string>",
"dateFormat": "<string>",
"conditions": [
{
"id": "<string>",
"field": "<string>",
"value": "<string>",
"displayValues": true
}
],
"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>"
}
]
}
}
]
}{
"message": "<string>",
"error": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"message": "<string>",
"error": "<string>"
}Quick Create Chart
Quick create a chart with all its chart dataset configs in one API call
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>",
"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,
"xAxis": "<string>",
"xAxisOperation": "<string>",
"yAxis": "<string>",
"dateField": "<string>",
"dateFormat": "<string>",
"conditions": [
{
"id": "<string>",
"field": "<string>",
"value": "<string>",
"displayValues": true
}
],
"formula": "<string>",
"datasetColor": "<string>",
"fillColor": "<string>",
"fill": false,
"multiFill": false,
"legend": "<string>",
"pointRadius": 123,
"excludedFields": [
"<string>"
],
"columnsOrder": [
"<string>"
],
"order": 1,
"maxRecords": 123,
"goal": 123,
"configuration": {
"variables": [
{
"name": "<string>",
"value": "<string>"
}
]
}
}
]
}
'import requests
url = "https://api.chartbrew.com/project/{project_id}/chart/quick-create"
payload = {
"project_id": 123,
"name": "<string>",
"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,
"xAxis": "<string>",
"xAxisOperation": "<string>",
"yAxis": "<string>",
"dateField": "<string>",
"dateFormat": "<string>",
"conditions": [
{
"id": "<string>",
"field": "<string>",
"value": "<string>",
"displayValues": True
}
],
"formula": "<string>",
"datasetColor": "<string>",
"fillColor": "<string>",
"fill": False,
"multiFill": False,
"legend": "<string>",
"pointRadius": 123,
"excludedFields": ["<string>"],
"columnsOrder": ["<string>"],
"order": 1,
"maxRecords": 123,
"goal": 123,
"configuration": { "variables": [
{
"name": "<string>",
"value": "<string>"
}
] }
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project_id: 123,
name: '<string>',
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,
xAxis: '<string>',
xAxisOperation: '<string>',
yAxis: '<string>',
dateField: '<string>',
dateFormat: '<string>',
conditions: [{id: '<string>', field: '<string>', value: '<string>', displayValues: true}],
formula: '<string>',
datasetColor: '<string>',
fillColor: '<string>',
fill: false,
multiFill: false,
legend: '<string>',
pointRadius: 123,
excludedFields: ['<string>'],
columnsOrder: ['<string>'],
order: 1,
maxRecords: 123,
goal: 123,
configuration: {variables: [{name: '<string>', value: '<string>'}]}
}
]
})
};
fetch('https://api.chartbrew.com/project/{project_id}/chart/quick-create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.chartbrew.com/project/{project_id}/chart/quick-create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'project_id' => 123,
'name' => '<string>',
'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,
'xAxis' => '<string>',
'xAxisOperation' => '<string>',
'yAxis' => '<string>',
'dateField' => '<string>',
'dateFormat' => '<string>',
'conditions' => [
[
'id' => '<string>',
'field' => '<string>',
'value' => '<string>',
'displayValues' => true
]
],
'formula' => '<string>',
'datasetColor' => '<string>',
'fillColor' => '<string>',
'fill' => false,
'multiFill' => false,
'legend' => '<string>',
'pointRadius' => 123,
'excludedFields' => [
'<string>'
],
'columnsOrder' => [
'<string>'
],
'order' => 1,
'maxRecords' => 123,
'goal' => 123,
'configuration' => [
'variables' => [
[
'name' => '<string>',
'value' => '<string>'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.chartbrew.com/project/{project_id}/chart/quick-create"
payload := strings.NewReader("{\n \"project_id\": 123,\n \"name\": \"<string>\",\n \"subType\": \"<string>\",\n \"public\": false,\n \"shareable\": false,\n \"displayLegend\": false,\n \"pointRadius\": 123,\n \"dataLabels\": false,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"dateVarsFormat\": \"<string>\",\n \"includeZeros\": true,\n \"currentEndDate\": false,\n \"fixedStartDate\": false,\n \"timeInterval\": \"day\",\n \"autoUpdate\": 123,\n \"draft\": true,\n \"mode\": \"chart\",\n \"maxValue\": 123,\n \"minValue\": 123,\n \"disabledExport\": true,\n \"onReport\": true,\n \"xLabelTicks\": \"default\",\n \"stacked\": false,\n \"horizontal\": false,\n \"showGrowth\": false,\n \"invertGrowth\": false,\n \"layout\": {},\n \"isLogarithmic\": false,\n \"content\": \"<string>\",\n \"ranges\": {\n \"ranges\": [\n {\n \"min\": 123,\n \"max\": 123,\n \"label\": \"<string>\"\n }\n ]\n },\n \"dashedLastPoint\": false,\n \"defaultRowsPerPage\": 10,\n \"chartDatasetConfigs\": [\n {\n \"dataset_id\": 123,\n \"xAxis\": \"<string>\",\n \"xAxisOperation\": \"<string>\",\n \"yAxis\": \"<string>\",\n \"dateField\": \"<string>\",\n \"dateFormat\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"displayValues\": true\n }\n ],\n \"formula\": \"<string>\",\n \"datasetColor\": \"<string>\",\n \"fillColor\": \"<string>\",\n \"fill\": false,\n \"multiFill\": false,\n \"legend\": \"<string>\",\n \"pointRadius\": 123,\n \"excludedFields\": [\n \"<string>\"\n ],\n \"columnsOrder\": [\n \"<string>\"\n ],\n \"order\": 1,\n \"maxRecords\": 123,\n \"goal\": 123,\n \"configuration\": {\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.chartbrew.com/project/{project_id}/chart/quick-create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": 123,\n \"name\": \"<string>\",\n \"subType\": \"<string>\",\n \"public\": false,\n \"shareable\": false,\n \"displayLegend\": false,\n \"pointRadius\": 123,\n \"dataLabels\": false,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"dateVarsFormat\": \"<string>\",\n \"includeZeros\": true,\n \"currentEndDate\": false,\n \"fixedStartDate\": false,\n \"timeInterval\": \"day\",\n \"autoUpdate\": 123,\n \"draft\": true,\n \"mode\": \"chart\",\n \"maxValue\": 123,\n \"minValue\": 123,\n \"disabledExport\": true,\n \"onReport\": true,\n \"xLabelTicks\": \"default\",\n \"stacked\": false,\n \"horizontal\": false,\n \"showGrowth\": false,\n \"invertGrowth\": false,\n \"layout\": {},\n \"isLogarithmic\": false,\n \"content\": \"<string>\",\n \"ranges\": {\n \"ranges\": [\n {\n \"min\": 123,\n \"max\": 123,\n \"label\": \"<string>\"\n }\n ]\n },\n \"dashedLastPoint\": false,\n \"defaultRowsPerPage\": 10,\n \"chartDatasetConfigs\": [\n {\n \"dataset_id\": 123,\n \"xAxis\": \"<string>\",\n \"xAxisOperation\": \"<string>\",\n \"yAxis\": \"<string>\",\n \"dateField\": \"<string>\",\n \"dateFormat\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"displayValues\": true\n }\n ],\n \"formula\": \"<string>\",\n \"datasetColor\": \"<string>\",\n \"fillColor\": \"<string>\",\n \"fill\": false,\n \"multiFill\": false,\n \"legend\": \"<string>\",\n \"pointRadius\": 123,\n \"excludedFields\": [\n \"<string>\"\n ],\n \"columnsOrder\": [\n \"<string>\"\n ],\n \"order\": 1,\n \"maxRecords\": 123,\n \"goal\": 123,\n \"configuration\": {\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chartbrew.com/project/{project_id}/chart/quick-create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": 123,\n \"name\": \"<string>\",\n \"subType\": \"<string>\",\n \"public\": false,\n \"shareable\": false,\n \"displayLegend\": false,\n \"pointRadius\": 123,\n \"dataLabels\": false,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"dateVarsFormat\": \"<string>\",\n \"includeZeros\": true,\n \"currentEndDate\": false,\n \"fixedStartDate\": false,\n \"timeInterval\": \"day\",\n \"autoUpdate\": 123,\n \"draft\": true,\n \"mode\": \"chart\",\n \"maxValue\": 123,\n \"minValue\": 123,\n \"disabledExport\": true,\n \"onReport\": true,\n \"xLabelTicks\": \"default\",\n \"stacked\": false,\n \"horizontal\": false,\n \"showGrowth\": false,\n \"invertGrowth\": false,\n \"layout\": {},\n \"isLogarithmic\": false,\n \"content\": \"<string>\",\n \"ranges\": {\n \"ranges\": [\n {\n \"min\": 123,\n \"max\": 123,\n \"label\": \"<string>\"\n }\n ]\n },\n \"dashedLastPoint\": false,\n \"defaultRowsPerPage\": 10,\n \"chartDatasetConfigs\": [\n {\n \"dataset_id\": 123,\n \"xAxis\": \"<string>\",\n \"xAxisOperation\": \"<string>\",\n \"yAxis\": \"<string>\",\n \"dateField\": \"<string>\",\n \"dateFormat\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"displayValues\": true\n }\n ],\n \"formula\": \"<string>\",\n \"datasetColor\": \"<string>\",\n \"fillColor\": \"<string>\",\n \"fill\": false,\n \"multiFill\": false,\n \"legend\": \"<string>\",\n \"pointRadius\": 123,\n \"excludedFields\": [\n \"<string>\"\n ],\n \"columnsOrder\": [\n \"<string>\"\n ],\n \"order\": 1,\n \"maxRecords\": 123,\n \"goal\": 123,\n \"configuration\": {\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"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,
"xAxis": "<string>",
"xAxisOperation": "<string>",
"yAxis": "<string>",
"yAxisOperation": "<string>",
"dateField": "<string>",
"dateFormat": "<string>",
"conditions": [
{
"id": "<string>",
"field": "<string>",
"value": "<string>",
"displayValues": true
}
],
"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>"
}
]
}
}
]
}{
"message": "<string>",
"error": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"message": "<string>",
"error": "<string>"
}chartDatasetConfigs[] item.
That includes xAxis, yAxis, yAxisOperation, dateField, dateFormat, conditions, formula, and legend.legend is chart-specific label text. If you omit it, Chartbrew falls back to the dataset name.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the project
Body
Create a chart with all its chart dataset configs in one API call. Per-series bindings belong in each chartDatasetConfigs item.
ID of the project
Name of the chart
The type of chart
line, bar, pie, doughnut, radar, polar, table, kpi, avg, gauge, matrix, markdown The sub-type of chart, currently only AddTimeseries is supported for accumulating timeseries data
Whether the chart is public
Whether the chart is shareable
Whether to display the chart.js legend
0 to hide, integer value to set the point radius
Whether to display the data labels on each data point on the chart
Used to inject a fixed start date into the chart
Used to inject a fixed end date into the chart
The format of the date variables in the chart
Whether to include zero-valued data points in the chart
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
Whether to force the start date to remain fixed
The time interval of the chart
second, minute, hour, day, week, month, year The interval in seconds at which the chart should be automatically updated
Whether the chart is a draft and should be hidden from dashboard viewers
Chart mode shows just the chart, kpichart shows a KPI on top of the chart.
chart, kpichart Cap the maximum shown value on the chart
Cap the minimum shown value on the chart
Whether to disable the export button for the chart
Whether to display the chart on the report
How many ticks to display on the x-axis
default, half, third, fourth, showAll Whether to stack the chart - only works for bar charts
Whether to display the chart horizontally - only works for bar charts
Whether to show the growth percentage at the top of the chart
When negative growth is meant to be positive and vice versa
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.
Show child attributes
Show child attributes
Whether to use a logarithmic scale for the y-axis
The content used for type=markdown
The ranges to display on the chart - only works for gauge charts
Show child attributes
Show child attributes
Whether to dash the last point on the chart - only works for line charts
Default number of rows per page for table charts
Array of chart dataset configs to create with the chart. The chart_id will be automatically set.
Show child attributes
Show child attributes
Response
Created chart with all chart dataset configs