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.
Type Parameters
Section titled “Type Parameters”TProps
Section titled “TProps”TProps extends UnifiedChartProps
Parameters
Section titled “Parameters”chartType
Section titled “chartType”The ECharts chart type
displayName
Section titled “displayName”string
Component display name for React DevTools
Returns
Section titled “Returns”A typed chart component
{(props): Element; displayName: string; }
displayName
Section titled “displayName”displayName:
string
Example
Section titled “Example”export const BarChart = createChart<BarChartProps>("bar", "BarChart");export const LineChart = createChart<LineChartProps>("line", "LineChart");