0.0.6 • Published 4 years ago

chartjs-plugin-axis-legend v0.0.6

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
4 years ago

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
... 
0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago