← 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
stringThe type of the chart to display, can be
line,scatter,bar,pie, ortime. The time type is a line chart that expects thexvalues in the data to be in the temporal domain.- Example:
"scatter" - Default value:
'line'
- Example:
- data
arrayA 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
stringThe data property to be used for the
xdimension.- Example:
"year" - Default value:
"x"
- Example:
- y
stringThe data property to be used for the
ydimension.- Example:
"value" - Default value:
"y"
- Example:
- domain
arrayThe chart extent along the x dimension.
- Example:
`[0, 1]` - Default value:
`[0, 1]`
- Example:
- range
arrayThe chart extent along the y dimension.
- Example:
`[0, 1]` - Default value:
`[0, 1]`
- Example:
- theme
stringThe theme to use, e.g.
grayscaleormaterialor a custom object (see an example here)- Example:
'material' - Default value:
'grayscale'
- Example: