
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
solid-chartjs
Advanced tools
The solid-chartjs library is a SolidJS wrapper around the Chart.js library, allowing you to easily create interactive charts in your SolidJS applications.
Installation:
pnpm add solid-chartjs chart.js
# or
yarn add solid-chartjs chart.js
# or
npm i solid-chartjs chart.js
Demo: solid-chartjs.vychs.com
Usage:
import { onMount } from 'solid-js'
import { Chart, Title, Tooltip, Legend, Colors } from 'chart.js'
import { Line } from 'solid-chartjs'
const MyChart = () => {
/**
* You must register optional elements before using the chart,
* otherwise you will have the most primitive UI
*/
onMount(() => {
Chart.register(Title, Tooltip, Legend, Colors)
})
const chartData = {
labels: ['January', 'February', 'March', 'April', 'May'],
datasets: [
{
label: 'Sales',
data: [50, 60, 70, 80, 90],
},
],
}
const chartOptions = {
responsive: true,
maintainAspectRatio: false,
}
return (
<div>
<Line data={chartData} options={chartOptions} width={500} height={500} />
</div>
)
}
If you don't want to import and register the controllers, elements, scales, and plugins you want to use, you can use the following solution:
[!NOTE]
It is considered to better use the tree-shakable way, to decrease the bundle size.
import 'chart.js/auto'
import { DefaultChart } from 'solid-chartjs'
<DefaultChart type="line" data={data} options={options} />
| Prop | Description | Type |
|---|---|---|
| width | The width of the chart canvas in pixels. | number | undefined |
| height | The height of the chart canvas in pixels. | number | undefined |
| fallback | A fallback element to display when chart fails. | JSX.Element |
| type | The type of the chart. | keyof ChartTypeRegistry |
| data | The chart data object. | ChartData | undefined |
| options | The chart options object. | ChartOptions | undefined |
| plugins | The chart plugins object. | Plugin[] | undefined |
Check out /dev folder and run the SolidJs application to see how it works.
You can also use the DefaultChart components:
[!NOTE]
DefaultChartis a wrapper aroundChartcomponent, so you can use all the props fromChartcomponent.DefaultChartcomponent does not have its registrable elements registered by default, so you need to register them yourself unless you usechart.js/auto.
import { onMount } from 'solid-js'
import {
Chart,
LineController,
CategoryScale,
PointElement,
LineElement,
LinearScale,
} from 'chart.js'
import { DefaultChart } from 'solid-chartjs'
const MyChart = () => {
onMount(() => {
Chart.register(LineController, CategoryScale, PointElement, LineElement, LinearScale)
})
// ... your data and options objects
return <DefaultChart type="line" data={data} options={options} width={400} height={300} />
}
Usage of fallback prop:
const fallback = () => {
return (
<div>
<p>Chart is not available</p>
</div>
)
}
<DefaultChart type="bar" data={chartData} options={chartOptions} fallback={fallback} />
FAQs
SolidJS components for Chart.js
The npm package solid-chartjs receives a total of 1,445 weekly downloads. As such, solid-chartjs popularity was classified as popular.
We found that solid-chartjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.