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

ItemValue
JavaScript propertyvalues
HTML attributePass objects, arrays, and callbacks as JavaScript properties
TypeLineChartValues | ScatterChartValues
Defaultnew Float32Array(0)

Configuration example

javascript
// 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"
  }
];