solid-echarts is a thin, idiomatic SolidJS wrapper around Apache ECharts 6. It exposes:
<SolidEChart /> component with reactive props and init-time optionscreateChart, createChartEffect, createAction) for building custom chart integrationsuseChart() hook for imperative accessCore use cases:
Install the library:
pnpm add @amad3v/solid-echarts echarts
or with npm:
npm install @amad3v/solid-echarts echarts
or with yarn:
yarn add @amad3v/solid-echarts echarts
Call seSetup once at application root before any <SolidEChart /> renders.
It registers the needed ECharts extensions (charts, components, renderers).
import {
seSetup,
BarChart,
LineChart,
GridComponent,
TooltipComponent,
CanvasRenderer,
} from "solid-echarts";
seSetup([BarChart, LineChart, GridComponent, TooltipComponent, CanvasRenderer]);
Only registered extensions are included in your bundle. ECharts is fully tree-shakable through this call.
seSetup is idempotent: calling it multiple times with already-registered extensions is a no-op.
const option = () => ({
xAxis: { type: "category", data: ["A", "B", "C"] },
yAxis: { type: "value" },
series: [{ type: "bar", data: [1, 2, 3] }],
});
<SolidEChart option={option} style={{ width: "100%", height: "320px" }} />;