Chart Element

PropTypeRequiredExampleValue RangeDescription
chartTypestringtrue--The type of chart to display. Supported types: bar, line, area, scatter, pie, doughnut, radar.
chartWidthnumbertrue-200 - 800The width of the chart canvas, in pixels.
chartHeightnumbertrue-150 - 600The height of the chart canvas, in pixels.
bgColorstringfalse--The background color of the chart, in hex format.
bgAlphanumberfalse-0 - 1The transparency level of the chart background. 1 represents full opacity, and 0 represents full transparency.
showAxisbooleanfalse--Whether to display the chart axes.
axisColorstringfalse--The color of the chart axes, in hex format.
axisWidthnumberfalse-1 - 10The width of the chart axes, in pixels.
showGridbooleanfalse--Whether to display the chart grid.
gridColorstringfalse--The color of the chart grid, in hex format.
gridAlphanumberfalse-0 - 1The transparency level of the chart grid. 1 represents full opacity, and 0 represents full transparency.
showLabelsbooleanfalse--Whether to display chart labels.
labelStyleobjectfalse--Text style configuration for chart labels.
labelStyle.fillstringfalse--The font color of chart labels, in hex format.
labelStyle.fontSizenumberfalse-8 - 100The font size of chart labels, in pixels.
labelStyle.fontFamilystringfalse--The font family of chart labels.
labelStyle.fontWeightstringfalse--The font weight of chart labels (e.g., normal, bold).
labelStyle.strokestringfalse--The stroke color of chart labels, in hex format.
labelStyle.strokeThicknessnumberfalse-0 - 10The stroke width of chart labels, in pixels.
labelStyle.dropShadowbooleanfalse--Whether to enable shadow effect for chart labels.
labelStyle.dropShadowColorstringfalse--The shadow color of chart labels, in hex format.
labelStyle.dropShadowBlurnumberfalse-0 - 20The blur radius of the label shadow.
labelStyle.dropShadowDistancenumberfalse-0 - 20The distance of the label shadow from the text.
labelStyle.dropShadowAnglenumberfalse-0 - 6.28The angle of the label shadow, in radians.
labelStyle.dropShadowAlphanumberfalse-0 - 1The opacity of the label shadow.
linePointStylestringfalse--The style of data points in line/area charts. Options: filled, hollow.
lineSmoothbooleanfalse--Whether to smooth the lines in line/area charts.
lineAreaAlphanumberfalse-0 - 1The transparency level of the filled area in area charts.
showLegendbooleanfalse--Whether to display the chart legend.
legendPositionstringfalse--The position of the legend. Currently supports: bottom.
legendItemSizenumberfalse-10 - 30The size of legend items, in pixels.
legendGapnumberfalse-4 - 20The gap between legend items, in pixels.
showBarBackgroundbooleanfalse--Whether to display the background of bar charts.
barBackgroundColorstringfalse--The background color of bars, in hex format.
barBackgroundAlphanumberfalse-0 - 1The transparency level of the bar background.
barOrientationstringfalse--The orientation of bars. Options: vertical, horizontal.
barCornerRadiusnumberfalse-0 - 20The corner radius of bars, in pixels.
dataSetarrayfalse--An array of data sets used to render the chart. Each data set contains a time point (dataTime) and data points (dataPoints).

Chart Types

The chartType property determines the visualization style:

  • bar: Vertical or horizontal bar chart
  • line: Line chart with optional smoothing
  • area: Area chart with filled regions
  • scatter: Scatter plot with data points
  • pie: Pie chart showing proportions
  • doughnut: Doughnut chart (pie chart with center hole)
  • radar: Radar/spider chart

Data Structure

The dataSet is an array of data objects, where each object contains:

  • dataTime: The time point relative to the ChartNode (in seconds)
  • dataPoints: An array of data points to be displayed at this time

Each data point in dataPoints contains:

  • id: Unique identifier for the data point
  • label: The label/name of the data point
  • value: The numeric value
  • color (optional): Custom color for this data point in hex format

Label Styling

The labelStyle object controls the appearance of chart labels:

  • Font properties: fill, fontSize, fontFamily, fontWeight
  • Stroke properties: stroke, strokeThickness
  • Shadow properties: dropShadow, dropShadowColor, dropShadowBlur, dropShadowDistance, dropShadowAngle, dropShadowAlpha

Line and Area Chart Features

For line and area charts, you can configure:

  • linePointStyle: Display data points as filled circles or hollow circles
  • lineSmooth: Enable smooth curves instead of straight lines
  • lineAreaAlpha: Control the opacity of the filled area (area charts only)

Bar Chart Features

For bar charts, you can configure:

  • barOrientation: Display bars vertically or horizontally
  • barCornerRadius: Round the corners of bars
  • showBarBackground: Display a background behind bars
  • barBackgroundColor/barBackgroundAlpha: Style the bar background

Legend Configuration

Enable and customize the chart legend:

  • showLegend: Toggle legend visibility
  • legendPosition: Position of the legend (currently supports "bottom")
  • legendItemSize: Size of legend color indicators
  • legendGap: Spacing between legend items
chartElement.json
1{ 2 "id": "chart-element-id", 3 "type": "Chart", 4 "start": 0, 5 "duration": 10, 6 "trackIndex": 0, 7 "x": 100, 8 "y": 100, 9 "chartType": "bar", 10 "chartWidth": 800, 11 "chartHeight": 600, 12 "bgColor": "#ffffff", 13 "bgAlpha": 1, 14 "showAxis": true, 15 "axisColor": "#000000", 16 "axisWidth": 2, 17 "showGrid": true, 18 "gridColor": "#cccccc", 19 "gridAlpha": 0.5, 20 "showLabels": true, 21 "labelStyle": { 22 "fill": "#333333", 23 "fontSize": 12, 24 "fontFamily": "Arial", 25 "fontWeight": "normal", 26 "stroke": "#000000", 27 "strokeThickness": 0, 28 "dropShadow": false, 29 "dropShadowColor": "#000000", 30 "dropShadowBlur": 4, 31 "dropShadowDistance": 3, 32 "dropShadowAngle": 1.2, 33 "dropShadowAlpha": 1 34 }, 35 "showLegend": true, 36 "legendPosition": "bottom", 37 "legendItemSize": 14, 38 "legendGap": 8, 39 "barOrientation": "vertical", 40 "barCornerRadius": 4, 41 "showBarBackground": false, 42 "barBackgroundColor": "#eeeeee", 43 "barBackgroundAlpha": 0.4, 44 "dataSet": [ 45 { 46 "dataTime": 0, 47 "dataPoints": [ 48 { "id": "1", "label": "A", "value": 10, "color": "#ff6384" }, 49 { "id": "2", "label": "B", "value": 20, "color": "#36a2eb" }, 50 { "id": "3", "label": "C", "value": 15, "color": "#ffce56" } 51 ] 52 }, 53 { 54 "dataTime": 5, 55 "dataPoints": [ 56 { "id": "1", "label": "A", "value": 25, "color": "#ff6384" }, 57 { "id": "2", "label": "B", "value": 18, "color": "#36a2eb" }, 58 { "id": "3", "label": "C", "value": 22, "color": "#ffce56" } 59 ] 60 } 61 ] 62} 63