Skip to content

Function: createChart()

createChart<TProps>(chartType, displayName): {(props): Element; displayName: string; }

Factory function to create chart components. Eliminates boilerplate by generating components with the same pattern.

TProps extends UnifiedChartProps

ChartType

The ECharts chart type

string

Component display name for React DevTools

A typed chart component

{(props): Element; displayName: string; }

displayName: string

export const BarChart = createChart<BarChartProps>("bar", "BarChart");
export const LineChart = createChart<LineChartProps>("line", "LineChart");