The Line chart plots data points connected by straight lines to visualize trends over time or categories. It’s helpful for showing changes and patterns, making it ideal for comparing different data sets and forecasting future values.
You can use either LineChart or QueryLineChart to visualize query results in a chart.Use QueryLineChart when you want the component to automatically handle the query fetching.Use LineChart when you already fetched the data using useQuery.
Specify a column name to return from your query. This will be the data in the horizontal (x) axis.See the section Axis X and Y to learn more about the options.
Specify the array of series you want to visualize. Each serie has the column name that your query and other properties.See the section Axis X and Y to learn more about the options.
Specify the order of the data returned by your query. It can be a string with the column name or an object with the column name and the order.See the sort section to learn more about the sort options
It allows you to customize how the information is displayed in the given axis. It contains several options.See the section xAxisFormat to learn more about the options.
It allows you to customize how the information is displayed in the given axis. It contains several options.See the section yFormat to learn more about the options.
Both x and y can contain multiple data series, so instead of specifying just a column name, you need to create a list of series using the following properties:
This prop tells the chart how to display the data. The options are:
line
bar
area
* If you are using <BarChart />, <LineChart />, <AreaChart /> this is not necessary. But if you’re
using <MixedChart /> you can specify chartType in each series to display the data in different ways. And if you’re using <ScatterChart /> you don’t need to specify chartType because it’s the only option available.
Specifies the group within an axis. Imagine 3 series that belong to the left side of the Y-axis, 2 of them need one specific format but the rest need another. axisIndex helps to define different formats for series on the same side of the axis.The options for this property are numbers: 0, 1, 2…How this link to axisFormat is by the order of the object in the arra of axisFormat. 1 will be the second object in the list, 0 is the first object in the list…
If you have a pivoted table where you have multiple columns with names like sum_users, sum_amount, sum_orders, (…) and you need to add all the columns without typing all the names you can use:
When “numeric” is compared with “non-numeric-string”, or either of them is compared with other types of value, they are not comparable. So we call the latter one as “incomparable” and treat it as “min value” or “max value” according to the prop incomparable: ‘min’ | ‘max’. This feature usually helps to decide whether to put the empty values (like null, undefined, NaN, '', '-') or other illegal values to the head or tail.
If intending to sort time values (JS Date instance or time string like 2012-03-12 11:13:54), parser: time should be specified.
If intending to sort values with unit suffix (like '33%', '16px'), need to use parser: number.