Required
id
*
|
:string
|
The ID used for the chart container
|
|
|
type
|
:string
|
|
"bar"
|
|
Available types: bar, line, pie, scatter, radar
|
series
|
:any
|
|
|
|
For bar/line charts:
-
A list of values: [10, 20, 30]
-
A list of maps with names: [%{name: “Series 1”, values: [10, 20, 30]}]
-
A list of series with different types: [%{name: “Bar”, type: “bar”, values: [10, 20, 30]}, %{name: “Line”, type: “line”, values: [5, 15, 25]}]
-
A list of time series: [%{name: “Series 1”, data: [[“2024-01-01”, 10], [“2024-01-02”, 20]]}]
For pie charts:
-
A list of maps with name and value: [%{name: “A”, value: 10}, %{name: “B”, value: 20}]
For scatter charts:
-
A list of [x, y] points: [[10, 20], [30, 40]]
-
A list of maps with series: [%{name: “Series 1”, data: [[10, 20], [30, 40]]}]
|
labels
|
:list
|
Category labels for the x-axis (for bar/line charts) or data point names (for pie charts).
Read more
Read less
|
[]
|
|
Example: [“Jan”, “Feb”, “Mar”]
|
title
|
:string
|
|
|
|
|
subtitle
|
:string
|
|
|
|
|
show_legend
|
:boolean
|
|
true
|
|
|
legend_position
|
:string
|
|
"top"
|
|
|
colors
|
:list
|
|
["var:noora-chart-primary", "var:noora-chart-secondary", "var:noora-chart-tertiary", "var:noora-chart-quaternary"]
|
|
The given items can either be a hex string, such as “#4C9AFF”, or a CSS variable, prefixed with var: , but omitting the -- prefix,
such as chart-primary .
The CSS variable is expected to be on the :root element, so the variable would be defined as such:
:root {
--chart-primary: #4C9AFF;
}
In addition, the color setting supports the light-dark() function, which can be used to automatically resolve the appropriate color
based on the the color scheme. That way, the variable can be defined as such:
:root {
--chart-primary: light-dark(#4C9AFF, #36B37E);
}
Example: [“#4C9AFF”, “#36B37E”, “#FF5630”, “#FFAB00”, “#6554C0”]
|
stacked
|
:boolean
|
|
false
|
|
|
show_values
|
:boolean
|
|
false
|
|
|
smooth
|
:boolean
|
For line charts, whether to use smooth curves instead of straight lines.
Read more
Read less
|
false
|
|
|
donut
|
:boolean
|
|
false
|
|
|
donut_radius
|
:list
|
|
["50%", "70%"]
|
|
|
x_axis_name
|
:string
|
|
|
|
|
y_axis_name
|
:string
|
|
|
|
|
x_axis_min
|
:integer
|
|
|
|
|
x_axis_max
|
:integer
|
|
|
|
|
y_axis_min
|
:integer
|
|
|
|
|
y_axis_max
|
:integer
|
|
|
|
|
grid_lines
|
:boolean
|
|
true
|
|
|
horizontal
|
:boolean
|
Whether to display a horizontal bar chart (with category axis on y-axis).
Read more
Read less
|
false
|
|
|
bar_width
|
:integer
|
|
|
|
|
bar_radius
|
:integer
|
|
|
|
|
extra_options
|
:map
|
Additional ECharts options for advanced customization.
|
%{}
|
|
rest
|
:global
|
Additional HTML attributes to add to the container div
|
|
|