This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

chartjs-plugin-axis-legend

0.0.6 • Public • Published

chartjs-plugin-axis-legend

npm version

This plugin adds small squares above the Y axis to see which dataset corresponds to which axis.

NOTE: This plugin is in development and the legend may not render properly for some values

example image

Installation

You can install the plugin using the npm:

npm install chartjs-plugin-axis-legend

Usage

Plugin has the following settings:

  • squareSize: size of the square in pixels
  • squareMargin: margin among squares
  • margin: margin from the left side of the axis

Example code on how to use this plugin:

import Chart from 'chart.js'
import AxisLegendPlugin from 'chartjs-plugin-axis-legend'

// Register plugin
Chart.plugins.register(AxisLegendPlugin)

// Plugin options
const options = {
    plugins: {
        axislegend: {
            squareSize: 8,
            squareMargin: 2,
            margin: 3
        }
    }
}

// Create Chart as usual
... 

Package Sidebar

Install

npm i chartjs-plugin-axis-legend

Weekly Downloads

3

Version

0.0.6

License

MIT

Unpacked Size

83.2 kB

Total Files

8

Last publish

Collaborators

  • fifal