API REFERENCE
values
Values for a single series. Use the data type required by the selected chart, such as a number array for Line or coordinate array for Scatter. Assign arrays and objects as JavaScript properties.
Definition
| Item | Value |
|---|---|
| JavaScript property | values |
| HTML attribute | Pass objects, arrays, and callbacks as JavaScript properties |
| Type | LineChartValues | ScatterChartValues |
| Default | new Float32Array(0) |
- LineChartValues
Type definition
- ScatterChartValues
Type definition
Configuration example
// Register sy-pie-chart and create the element before configuring it.
chart.values = [
{
"name": "Product A",
"value": 42,
"color": "#8263d9"
},
{
"name": "Product B",
"value": 28,
"color": "#239c91"
},
{
"name": "Product C",
"value": 18,
"color": "#e99954"
},
{
"name": "Other",
"value": 12,
"color": "#d76c8f"
}
];