@maxhealth.tech/prefab / auto / autoChart
Function: autoChart()
ts
function autoChart(
data,
series,
options?): ContainerComponent;Defined in: auto/chart.ts:43
Auto-generate a chart Card from data and series definitions.
Parameters
| Parameter | Type |
|---|---|
data | Record<string, unknown>[] |
series | ChartSeries[] |
options? | AutoChartOptions |
Returns
ContainerComponent
Example
ts
autoChart(
[{ month: 'Jan', revenue: 42000, cost: 31000 }],
[{ dataKey: 'revenue', label: 'Revenue' }, { dataKey: 'cost', label: 'Cost' }],
{ title: 'Monthly Revenue', xAxis: 'month', chartType: 'bar' },
)