← Back
Chart
This will display a chart.
Input:
[var name:"dataToBeCharted" value:`[
{x: 0, y: 0.5},
{x: 3.5, y: 0.5},
{x: 4, y: 0},
{x: 4.5, y: 1},
{x: 5, y: 0.5},
{x: 8, y: 0.5}
]` /]
[Chart type:"line" data:dataToBeCharted domain:`[0, 8]` range:`[0, 1]` /]
Output:
Props
- type
string
The type of the chart to display, can be
line
,scatter
,bar
,pie
, ortime
. The time type is a line chart that expects thex
values in the data to be in the temporal domain.- Example:
"scatter"
- Default value:
'line'
- Example:
- data
array
A JSON object containing the data for this chart. It uses the victory library to handle rendering, so see those docs for more information on what types of data can be passed in.
- Example:
`[{year: 1, value: 1}, { year: 2, value: 2 }]`
- Example:
- x
string
The data property to be used for the
x
dimension.- Example:
"year"
- Default value:
"x"
- Example:
- y
string
The data property to be used for the
y
dimension.- Example:
"value"
- Default value:
"y"
- Example:
- domain
array
The chart extent along the x dimension.
- Example:
`[0, 1]`
- Default value:
`[0, 1]`
- Example:
- range
array
The chart extent along the y dimension.
- Example:
`[0, 1]`
- Default value:
`[0, 1]`
- Example:
- theme
string
The theme to use, e.g.
grayscale
ormaterial
or a custom object (see an example here)- Example:
'material'
- Default value:
'grayscale'
- Example: