Pie Chart Data Structure Description¶
// Below is a demo of a pie chart (divided into 3 slices)
{
series: [
{
values: [[null, 1.33635905]],
columns: ['time', 'pieA'],
},
{
values: [[null, 1.79202423]],
columns: ['time', 'pieB'],
},
{
values: [[null, 2]],
columns: ['time', 'pieC'],
},
],
},
- Field Description:
| Parameter | Type | Required | Description |
|---|---|---|---|
| series | list | Yes | Data groups, the length indicates how many slices the pie chart has |
| series[#] | dict | A set of data representing one slice of the pie chart | |
| series[#].columns | list | Yes | The first item of the pie chart is fixed as the field time, the second item is the slice name: ['time', 'slice name'] |
| series[#].values | list | Yes | Two-dimensional array. In a pie chart, there should be only one data entry; if multiple, only the first one is used |
| series[#].values[#] | list | A data source composed of [time value, data value]. In the pie chart, the first value can be set to null, the second is the data value (the reference value for the pie chart proportion) |
|