One Charts API
With One Charts API you can create, read, update, delete the charts in machine-readable JSON format.
To interact with the API, you need to send a HTTP-request to address https://onecharts.io/api
with method-specific parameters. Each method description has an example URL.
Each method call returns a JSON-object with three possible fields: success, message and result (which is method specific).
- success is either
true
orfalse
. - If success is
false
then message contains the reason why the request failed. If success istrue
, then there is no message. - If success is
true
then result contains method-dependent JSON-element which will be described for each method separately. If success isfalse
, then there is no result.
Authentication
The One Charts API uses API key to authenticate requests. You can view and manage your API keys in the dashboard. Authentication to the API is performed via bearer auth. Use -H "Authorization: Bearer <API_KEY>"
. All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
API Methods
Get User Charts
Get charts owned by an user
Query Parameters
username
string
Required
Username of the user whose charts you want to fetch. Only the charts which are public or the charts for which you have the access will be retrieved.
q
string
Filter the charts with the title containing this query q
as a substring.
Response status codes
Status Code | Description |
---|---|
200 | OK |
404 | Occurs when the username does not exist |
400 | Occurs when the request is invalid, for example if the username field is missing in request, etc., |
Response Schema
charts
array
List of chart objects
success
bool
Indicates whether the request has succeeded or failed.
message
string
Briefly explains the error.
GET
/api/user_charts
$ curl \
--location 'https://onecharts.io/api/user_charts?username=adam&q=stock' \
--request GET \
--header 'Authorization: Bearer <API_KEY>'
{
"charts":[
{
"chart_id":"k-jOPzitp-MzB6",
"chart_title":"top 10 stocks",
"created_time":"2022-12-17T11:04:21.307Z",
"chart_type":"pie",
"chart_sub_type":"basic_pie",
"thumbnail_path":"piechart",
"cloned_from":"piechart"
},
{
"chart_id":"o-SDEvxw9-7A0g",
"chart_title":"dowjones Stocks daily trend",
"created_time":"2022-12-17T11:04:21.307Z",
"chart_type":"line",
"chart_sub_type":"basicline",
"thumbnail_path":"linechart",
"cloned_from":"linechart"
},
],
"success":true
}
Create New Chart
creates new chart by cloning an existing chart.
Body Parameters
chart_id
string
Required
The ID of the chart to clone from.
chart_title
string
Title of chart.
notes
string
Notes for this chart
visibility
string
The visibility of the chart. It should be either public or private. By default, visibility is private. If the visibility is private, only the owner of the chart can view. If the visibility is public, anyone can view the chart.
data
object
If data is not provided, the new chart will be created using the data of the provided chart_id. If data is provided, the new chart will be created with the provided data. Following is the data object based on different chart type and chart sub type. The chart type and chart sub type of the new chart are same as the existing chart.
Chart Type | Chart Sub Type | Data object |
---|---|---|
line | basic_line | LineChartDataObject |
line | area | LineChartDataObject |
line | stack | LineChartDataObject |
line | stacked_area | LineChartDataObject |
bar | basic_bar | BarChartDataObject |
bar | basic_bar_negative_values | BarChartDataObject |
bar | horizontal_basic_bar | BarChartDataObject |
bar | stack | BarChartDataObject |
bar | horizontal_stack | BarChartDataObject |
heatmap | calendar | CalendarHeatmapChartDataObject |
candlestick | basic_candlestick | CandleStickChartDataObject |
pie | basic_pie | PieChartDataObject |
pie | nightingale | PieChartDataObject |
pie | doughnut | PieChartDataObject |
funnel | basic_funnel | FunnelChartDataObject |
heatmap | heatmap | HeatmapChartDataObject |
radar | basic_radar | RadarChartDataObject |
sankey | basic_sankey | SankeyChartDataObject |
scatter | basic_scatter | ScatterChartDataObject |
punchcard | punchcard | PunchcardChartDataObject |
tree | basic_tree | TreeChartDataObject |
treemap | treemap | TreeMapChartDataObject |
sunburst | basic_sunburst | SunBurstChartDataObject |
Response status codes
Status Code | Description |
---|---|
200 | OK |
400 | Occurs when the chart_id is missing or if there is an error with the provided parameters. |
Response Schema
chart_id
string
The new chart ID.
success
bool
Indicates whether the request has succeeded or not.
message
string
Briefly highlights the error.
POST
/api/chart
$ curl --location \
'https://onecharts.io/api/chart' \
--request POST \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"chart_id": "k-jOPzitp-MzB6",
"chart_title": "monthly sales vs. revenue",
"visibility": "private",
"notes": "some notes"
"data": {
"labels": ["Jan"],
"dimensions": ["Lions", "Deers"],
"dataset": [
{
"name": "Jan",
"dimensions": [
{
"name": "Lions",
"value": 20
},
{
"name": "Deers",
"value": 40
}
]
}
]
}
}'
{
"chart_id":"k-IN26kbP-x30V",
"success":true
}
Get Chart Config
Get the config of a chart. You need to be owner of the chart or you need to have the access inorder to view.
Query Parameters
chart_id
string
Required
ID of the chart that you want to retrieve.
Response status codes
Status Code | Description |
---|---|
200 | OK |
404 | Occurs when the chart_id does not exist |
400 | Occurs when the chart_id is missing or if the provided parameters are invalid. |
403 | Occurs when you do not have permission to view the chart |
Response Schema
chart
object
success
bool
Indicates whether the requests has succeeded or not.
message
string
Briefly highlights the error.
GET
/api/chart
$ curl \
--location 'https://onecharts.io/api/chart?chart_id=k-jOPzitp-MzB6' \
--request GET \
--header 'Authorization: Bearer <API_KEY>'
{
"chart": {
"chart_id": "k-jOPzitp-MzB6",
"chart_title": "covid trend",
"created_time": "2022-12-25T12:13:04.127Z",
"modified_time": "2022-12-25T12:13:04.127Z",
"chart_type": "bar",
"chart_sub_type": "basic_bar_negative_values",
"thumbnail_path": "https://static.onecharts.io/img/barchartwithnegativevalues.webp",
"cloned_from": "barchartwithnegativevalues",
"owner": "adam",
"notes": "",
"visibility": "private",
"chart_options": {
"title": {
"text": "Line Chart",
"textAlign": "center",
"left": "50%",
"top": "0%",
},
"legend": {
"align": "auto",
"left": "center",
"bottom": "0%",
"right": "0%"
},
"xAxis": {
"type": "category",
"boundaryGap": false
},
}
},
"success": true
}
Update Chart Config
Updates the config of a chart. You need to be owner of the chart inorder to update.
Body Parameters
chart_id
string
Required
Chart ID of a chart that you want to update.
chart_title
string
The new title of the chart.
notes
string
The new notes.
visibility
string
The new visibility of the chart
password
string
The new password for the chart
chart_options
object
The E-Charts compatible chart options.
Response status codes
Status Code | Description |
---|---|
200 | OK |
404 | Occurs when the chart_id does not exist |
400 | Occurs when the chart_id field is missing. |
403 | Occurs when you do not have permission to edit the chart |
Response Schema
status
bool
Indicates whether the request has succeeded or not.
message
string
Briefly highlights the error if the success is false.
PATCH
/api/chart
$ curl \
--location 'https://onecharts.io/api/chart' \
--request PATCH \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"chart_id": "k-jOPzitp-MzB6",
"chart_options": {
"title": [{
"text": "Line Chart",
"textAlign": "center",
"left": "50%",
"top": "0%"
}],
"legend": [{
"align": "auto",
"left": "center",
"bottom": "0%",
"right": "0%"
}],
"xAxis": [{
"type": "category",
"boundaryGap": true
}]
},
"notes": "New notes that needs to be added",
"visibility": "public"
}'
{
"success": true
}
Get Chart Data
Get the data of a chart. You need to be owner of the chart or the chart needs to be public inorder to view.
Query Parameters
chart_id
string
Required
Chart ID for which we are about to delete.
Response status codes
Status Code | Description |
---|---|
200 | OK |
404 | Occurs when the chart_id does not exist |
400 | The chart_id field is missing |
403 | Occurs when you do not have permission to view the chart |
Response Schema
data
object
Chart data. Depending on chart type and chart subtype, following is the schema of the chart data object.
Chart Type | Chart Sub Type | Data object |
---|---|---|
line | basic_line | LineChartDataObject |
line | area | LineChartDataObject |
line | stack | LineChartDataObject |
line | stacked_area | LineChartDataObject |
bar | basic_bar | BarChartDataObject |
bar | basic_bar_negative_values | BarChartDataObject |
bar | horizontal_basic_bar | BarChartDataObject |
bar | stack | BarChartDataObject |
bar | horizontal_stack | BarChartDataObject |
heatmap | calendar | CalendarHeatmapChartDataObject |
candlestick | basic_candlestick | CandleStickChartDataObject |
pie | basic_pie | PieChartDataObject |
pie | nightingale | PieChartDataObject |
pie | doughnut | PieChartDataObject |
funnel | basic_funnel | FunnelChartDataObject |
heatmap | heatmap | HeatmapChartDataObject |
radar | basic_radar | RadarChartDataObject |
sankey | basic_sankey | SankeyChartDataObject |
scatter | basic_scatter | ScatterChartDataObject |
punchcard | punchcard | PunchcardChartDataObject |
tree | basic_tree | TreeChartDataObject |
treemap | treemap | TreeMapChartDataObject |
sunburst | basic_sunburst | SunBurstChartDataObject |
success
bool
Indicates whether the requests has succeeded or not.
message
string
Briefly highlights the error if the success is false.
GET
/api/chart_data
$ curl \
--location 'https://onecharts.io/api/chart_data?chart_id=k-jOPzitp-MzB6' \
--request GET \
--header 'Authorization: Bearer <API_KEY>'
{
"data": {
"labels": [
"Jan",
"Feb",
"Mar"
],
"dimensions": [
"Sales",
"Revenue"
],
"dataset": [
{
"name": "Jan",
"dimensions": [
{
"name": "Sales",
"value": 1439
},
{
"name": "Revenue",
"value": 1200
}
]
},
{
"name": "Feb",
"dimensions": [
{
"name": "Sales",
"value": 1593
},
{
"name": "Revenue",
"value": 1693
}
]
}
]
},
"success": true
}
Update Chart Data
Updates the data of a chart. You need to be owner of the chart inorder to update.
Body Parameters
chart_id
string
Required
Chart ID of the chart for which you are about to update.
overwrite
bool
If set to true, the existing data will be replaced completely with new data.
data
object
Required
The data that needs to be updated. Following is the data object based on different chart type and chart sub type.
Chart Type | Chart Sub Type | Data object |
---|---|---|
line | basic_line | LineChartDataObject |
line | area | LineChartDataObject |
line | stack | LineChartDataObject |
line | stacked_area | LineChartDataObject |
bar | basic_bar | BarChartDataObject |
bar | basic_bar_negative_values | BarChartDataObject |
bar | horizontal_basic_bar | BarChartDataObject |
bar | stack | BarChartDataObject |
bar | horizontal_stack | BarChartDataObject |
heatmap | calendar | CalendarHeatmapChartDataObject |
candlestick | basic_candlestick | CandleStickChartDataObject |
pie | basic_pie | PieChartDataObject |
pie | nightingale | PieChartDataObject |
pie | doughnut | PieChartDataObject |
funnel | basic_funnel | FunnelChartDataObject |
heatmap | heatmap | HeatmapChartDataObject |
radar | basic_radar | RadarChartDataObject |
sankey | basic_sankey | SankeyChartDataObject |
scatter | basic_scatter | ScatterChartDataObject |
punchcard | punchcard | PunchcardChartDataObject |
tree | basic_tree | TreeChartDataObject |
treemap | treemap | TreeMapChartDataObject |
sunburst | basic_sunburst | SunBurstChartDataObject |
Response status codes
Status Code | Description |
---|---|
200 | OK |
404 | Occurs when the chart_id does not exist |
400 | The chart_id field is missing |
403 | Occurs when you do not have permission to update the chart |
Response Schema
success
bool
Indicates whether the requests has succeeded or not.
message
string
Briefly highlights the error.
PATCH
/api/chart_data
$ curl \
--location 'https://onecharts.io/api/chart_data' \
--request PATCH \
--header 'Authorization: Bearer API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"chart_id": "k-jOPzitp-MzB6",
"data": {
"labels": ["Jan"],
"dimensions": ["Sales", "Revenue"],
"dataset": [
{
"name": "Jan",
"dimensions": [
{
"name": "Sales",
"value": 20
},
{
"name": "Revenue",
"value": 40
}
]
}
]
},
"overwrite": true
}'
{
"success":true
}
Delete Chart
Deletes a chart. You need to be owner of the chart inorder to delete.
Body Parameters
chart_id
string
Required
ID of the chart that you want to delete
Response status codes
Status Code | Description |
---|---|
200 | OK |
400 | The chart_id field is missing |
403 | Occurrs when you do not have permission to delete the chart |
Response Schema
success
bool
Indicates whether the chart has been deleted or not
message
string
Briefly highlights the error.
DELETE
/api/chart
$ curl \
--location 'https://onecharts.io/api/chart' \
--request DELETE \
--header 'Authorization: Bearer APi_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"chart_id": "k-jOPzitp-MzB6"
}'
{
"success":true
}
Chart Object
Schema
chart_id
string
Chart ID.
chart_title
string
Title of the chart
created_time
timestamp
Time at which this chart was created.
modified_time
timestamp
Time at which this chart was last modified.
chart_type
string
Chart Type.
chart_sub_type
string
Chart Sub type.
thumbnail_path
string
URL of the thumbnail.
cloned_from
string
The chart from which this chart has been cloned.
owner
string
The owner of the chart.
notes
string
The notes for this chart.
visibility
string
Visibility of the chart.
{
"chart_id": "k-jOPzitp-MzB6",
"chart_title": "% of world population",
"created_time": "2022-12-25T12:13:04.127Z",
"modified_time": "2022-12-25T12:13:04.127Z",
"chart_type": "pie",
"chart_sub_type": "basic_pie",
"thumbnail_path": "basic_pie",
"cloned_from": "o-eOPSiu7-c9Id",
"owner": "bob",
"notes": "this chart contains the percentage of world population...",
"visibility": "private"
}
Line Chart Data Object
The data object for line chart.
Schema
data
object
Required
data contains the three fields labels, dimensions and dataset as described below.
labels
Array of strings
The list of labels. Note that order matters
dimensions
Array of strings
The list of dimensions. Note that order matters
dataset
Array of object
The list of data object, each object consists of name and dimensions as described below.
name
string
The label name
dimensions
Array of objects
The values for the dimensions corresponding to this label, each object consists of a name and value as described below.
name
string
The dimension name
value
float
The values
{
"data": {
"labels": [
"Jan",
"Feb",
"Mar",
"Apr"
],
"dimensions": [
"Sales",
"Revenue"
],
"dataset": [
{
"name": "Jan",
"dimensions": [
{
"name": "Sales",
"value": 1439
},
{
"name": "Revenue",
"value": 1200
}
]
},
{
"name": "Feb",
"dimensions": [
{
"name": "Sales",
"value": 1593
},
{
"name": "Revenue",
"value": 1693
}
]
},
{
"name": "Mar",
"dimensions": [
{
"name": "Sales",
"value": 200
}
]
},
{
"name": "Apr",
"dimensions": [
{
"name": "Revenue",
"value": 900
}
]
}
]
}
}
Bar Chart Data Object
The data object for bar chart.
Schema
data
object
Required
data contains the three fields: labels, dimensions and dataset as described below.
labels
Array of strings
The list of labels. Note that order matters
dimensions
Array of strings
The list of dimensions. Note that order matters
dataset
Array of object
The list of objects, each object consists of a name, dimensions as described below.
name
string
The label name
dimensions
Array of objects
The list of dimension objects corresponding to this label. Each dimension object contains a name and the value as described below.
name
string
The dimension name
value
float
The value.
{
"data": {
"labels": [
"Jan",
"Feb",
"Mar",
"Apr"
],
"dimensions": [
"Sales",
"Revenue"
],
"dataset": [
{
"name": "Jan",
"dimensions": [
{
"name": "Sales",
"value": 1439
},
{
"name": "Revenue",
"value": 1200
}
]
},
{
"name": "Feb",
"dimensions": [
{
"name": "Sales",
"value": 1593
},
{
"name": "Revenue",
"value": 1693
}
]
},
{
"name": "Mar",
"dimensions": [
{
"name": "Sales",
"value": 200
}
]
},
{
"name": "Apr",
"dimensions": [
{
"name": "Revenue",
"value": 900
}
]
}
]
}
}
Pie Chart Data Object
The data object for pie chart.
Schema
data
object
Required
data contains the two fields labels and dataset as described below.
labels
Array of strings
The list of labels. Note that order matters
dataset
Array of object
The list of data objects, each object consists of name and value as described below.
name
string
The label name
value
float
The values for this label
{
"data": {
"labels": [
"Jan",
"Feb",
"Mar",
"Apr"
],
"dataset": [
{
"name": "Jan",
"value": 12
},
{
"name": "Feb",
"value": 16
},
{
"name": "Mar",
"value": 19
},
{
"name": "Apr",
"value": 22
}
]
}
}
Scatter Chart Data Object
The data object for scatter chart.
Schema
data
object
Required
data contains the two fields labels and dataset as described below.
labels
Array of strings
The list of labels. Note that order matters
dataset
Array of object
The list of data objects, each object consists of two fields name and points as described below.
name
string
The label name
points
Array of objects
The coordinates of the points, each point consists of x and y fields as described below.
x
float
The X coordinate of the point.
y
float
The Y coordinate of the point.
{
"data":{
"labels":[
"Points A",
"Points B"
],
"dataset":[
{
"name":"Points A",
"points":[
{
"x":1.49,
"y":-9.12
},
{
"x":-4.5,
"y":-3.09
},
{
"x":7.83,
"y":-0.76
}
]
},
{
"name":"Points B",
"points":[
{
"x":3.68,
"y":1.95
},
{
"x":6.84,
"y":-4.6
},
{
"x":-4.9,
"y":-3.43
}
]
}
]
},
"success":true
}
Punchcard Chart Data Object
The data object for punchcard chart.
Schema
data
object
Required
data contains the three fields x_axis_labels, y_axis_labels and dataset as described below.
x_axis_labels
Array of strings
The X Axis Labels
y_axis_labels
Array of strings
The Y Axis labels
dataset
Array of object
The list of data objects, each object consists of x_axis_label, y_axis_label and value ad described below.
x_axis_label
string
The x_axis_label name
y_axis_label
string
The y_axis_label name
value
float
The value.
{
"data":{
"x_axis_labels":[
"9am",
"10am",
"11am",
"12pm",
],
"y_axis_labels":[
"Sun",
"Mon",
"Tue",
],
"dataset":[
{
"x_axis_label":"9am",
"y_axis_label":"Mon",
"value":5
},
{
"x_axis_label":"9am",
"y_axis_label":"Tue",
"value":10
},
{
"x_axis_label":"12pm",
"y_axis_label":"Wed",
"value":8
}
]
},
"success":true
}
Heatmap Chart Data Object
The data object for heatmap chart.
Schema
data
object
Required
data contains the three fields x_axis_labels, y_axis_labels and dataset as described below.
x_axis_labels
Array of strings
The X Axis Labels
y_axis_labels
Array of strings
The Y Axis labels
dataset
Array of object
The list of data object, each object consists of x_axis_label, y_axis_label and value as described below.
x_axis_label
string
The x_axis_label name
y_axis_label
string
The y_axis_label name
value
float
The value.
{
"data":{
"x_axis_labels":[
"9am",
"10am",
"11am",
"12pm",
],
"y_axis_labels":[
"Sun",
"Mon",
"Tue",
],
"dataset":[
{
"x_axis_label":"9am",
"y_axis_label":"Mon",
"value":5
},
{
"x_axis_label":"9am",
"y_axis_label":"Tue",
"value":10
},
{
"x_axis_label":"12pm",
"y_axis_label":"Wed",
"value":8
}
]
},
"success":true
}
Candlestick Chart Data Object
The data object for candlestick chart.
Schema
data
object
Required
data contains the two fields: labels and dataset as described below.
dataset
Array of object
The list of objects, each object consists of a day, high, open, close and low as described below.
day
string
The timestamp as string in TZ format.
high
float
The high value
open
float
The open value
close
float
The close value
low
float
The low value
{
"data":{
"dataset":[
{
"day":"2022-04-01",
"high":38,
"open":20,
"close":34,
"low":10
},
{
"day":"2022-04-02",
"high":50,
"open":40,
"close":35,
"low":30
},
{
"day":"2022-04-03",
"high":44,
"open":31,
"close":38,
"low":33
},
{
"day":"2022-04-04",
"high":42,
"open":38,
"close":15,
"low":5
}
]
},
"success":true
}
Radar Chart Data Object
The data object for radar chart.
Schema
data
object
Required
data contains two fields, indicators and dataset as described below.
indicators
Array of object
The list of indicators objects, each object consists of a name and max value.
name
string
The name of the indicator.
max
float
The maximum value of the indicator.
dataset
Array of object
The list of data objects, each object consists of a name and dimensions as described beloe
name
string
Name of the dataset
dimensions
Array of object
The list of dimensions, each object consists of a name and value.
name
string
The name of the indicator.
value
float
The value of the indicator.
{
"data":{
"indicators":[
{
"name":"Sales",
"max":6500,
},
{
"name":"Administration",
"max":16000,
},
{
"name":"Information Technology",
"max":30000,
}
],
"dataset":[
{
"name":"Predicted",
"dimensions":[
{
"name":"Sales",
"value":4200
},
{
"name":"Administration",
"value":3000
},
{
"name":"Information Technology",
"value":20000
}
]
},
{
"name":"Actual",
"dimensions":[
{
"name":"Sales",
"value":5000
},
{
"name":"Administration",
"value":14000
},
{
"name":"Information Technology",
"value":28000
}
]
}
]
},
"success":true
}
Calendar Heatmap Chart Data Object
The data object for calendar heatmap chart.
Schema
data
object
Required
data contains the two fields: labels and dataset as described below.
dataset
Array of object
The list of objects. Each object contains a day and value as described below.
day
string
Day in the form of YYYY-MM-DD.
value
float
Value for the day.
{
"data":{
"dataset":[
{
"day":"2022-12-01",
"value":10
},
{
"day":"2022-12-02",
"value":12
},
{
"day":"2022-12-03",
"value":16
}
]
},
"success":true
}
Sankey Chart Data Object
The data object for sankey chart.
Schema
data
object
Required
data contains the two fields nodes and links as described below.
nodes
Array of strings
The list of nodes
links
Array of objects
The list of edges, each edge object consists of three fields source, target and value as described below.
source
string
Source node.
target
string
Target node.
value
float
Value of the edge.
{
"data":{
"nodes":[
"Node 1",
"Node 2",
"Node 3",
],
"links":[
{
"source":"Node 2",
"target":"Node 1",
"value":5
},
{
"source":"Node 1",
"target":"Node 3",
"value":3
},
{
"source":"Node 2",
"target":"Node 3",
"value":8
}
]
},
"success":true
}
Funnel Chart Data Object
The data object for funnel chart.
Schema
data
object
Required
data contains one field: dataset as described below.
dataset
Array of object
The list of data object, each object consists of name and value as described below.
name
string
The label name
value
float
The values for this label
{
"data": {
"dataset": [
{
"name": "Jan",
"value": 12
},
{
"name": "Feb",
"value": 16
},
{
"name": "Mar",
"value": 19
},
{
"name": "Apr",
"value": 22
}
]
}
}
Sun Burst Chart Data Object
The data object for sun burst chart.
Schema
data
object
Required
data contains the three fields roots, nodes and edges as described below.
roots
Array of strings
The list of root nodes
nodes
Array of objects
The list of nodes, each node object consists of two fields node and value as described below.
node
string
Node name.
value
float
Value of the node.
edges
Array of objects
The list of edges, each edge object consists of two fields source and target as described below.
source
string
Source node.
target
string
Target node.
{
"data":{
"roots":[
"Root 1",
"Root 2"
],
"nodes": [
{
"node": "Root 1",
"value": 1
},
{
"node": "Root 2",
"value": 2
},
{
"node": "node 1",
"value": 3
},
{
"node": "node 2",
"value": 4
},
{
"node": "node 3",
"value": 5
},
{
"node": "node 4",
"value": 6
},
],
"edges":[
{
"source":"Root 1",
"target":"node 1",
},
{
"source":"node 1",
"target":"node 2",
},
{
"source":"node 1",
"target":"node 3",
},
{
"source":"Root 2",
"target":"node 4",
},
]
},
"success":true
}
Tree Chart Data Object
The data object for tree chart.
Schema
data
object
Required
data contains the two fields root and edges as described below.
root
string
The root node.
edges
Array of objects
The list of edges, each edge object consists of two fields source and target as described below.
source
string
Source node.
target
string
Target node.
{
"data":{
"root": "Root 1",
"edges":[
{
"source":"Root 1",
"target":"node 1",
},
{
"source":"node 1",
"target":"node 2",
},
{
"source":"node 1",
"target":"node 3",
},
{
"source":"Root 2",
"target":"node 4",
},
]
},
"success":true
}
Tree Map Chart Data Object
The data object for tree map chart.
Schema
data
object
Required
data contains the three fields roots, nodes and edges as described below.
roots
Array of strings
The list of root nodes
nodes
Array of objects
The list of nodes, each node object consists of two fields node and value as described below.
node
string
Node name.
value
float
Value of the node.
edges
Array of objects
The list of edges, each edge object consists of two fields source and target as described below.
source
string
Source node.
target
string
Target node.
{
"data":{
"roots":[
"Root 1",
"Root 2"
],
"nodes": [
{
"node": "Root 1",
"value": 1
},
{
"node": "Root 2",
"value": 2
},
{
"node": "node 1",
"value": 3
},
{
"node": "node 2",
"value": 4
},
{
"node": "node 3",
"value": 5
},
{
"node": "node 4",
"value": 6
},
],
"edges":[
{
"source":"Root 1",
"target":"node 1",
},
{
"source":"node 1",
"target":"node 2",
},
{
"source":"node 1",
"target":"node 3",
},
{
"source":"Root 2",
"target":"node 4",
},
]
},
"success":true
}