Skip to content

Getting Started

chartjs-plugin-autocolors is a Chart.js plugin that automatically generates colors for datasets, based on Janus Troelsen’s answer at Stack Overflow.

This plugin requires Chart.js 3.0.0 or later. Could work with v2, but it is not supported.

NOTE: the plugin does not automatically register.

Terminal window
npm install chart.js chartjs-plugin-autocolors
import { Chart } from 'chart.js'
import autocolors from 'chartjs-plugin-autocolors'
Chart.register(autocolors)

Continue with the editable basic sample.