Skip to content

Getting Started

chartjs-plugin-gradient is a Chart.js plugin for easy gradient colors on chart datasets.

This plugin requires Chart.js 3.0.0 or later. It should also work with v2, but there are no regression tests to guarantee this.

Terminal window
npm install chart.js chartjs-plugin-gradient

The plugin does not register itself automatically. Register it once to enable it for every chart.

import { Chart } from 'chart.js'
import gradient from 'chartjs-plugin-gradient'
Chart.register(gradient)

Continue with the editable background gradient sample.