0.1.5 • Published 7 years ago

chartsjs-plugin-data-labels v0.1.5

Weekly downloads
38
License
ISC
Repository
github
Last release
7 years ago

npm

chartsjs-plugin-data-labels

Plugin for ChartJS to draw labels on charts

Installation

You can download the latest version of Plugin for ChartJS to draw labels on charts from the GitHub releases

To install via npm:

npm i chartsjs-plugin-data-labels

Configuration

To configure this plugin, you can simply add the following entries to your chart options:

NameTypeDefaultDescription
displayBooleantruetrue to enable this graph, else false to disable it for the associated graph.
fontSizeNumberChart.defaults.global.defaultFontSize
fontStyleStringChart.defaults.global.defaultFontStyle
fontFamilyStringChart.defaults.global.defaultFontFamily
colorStringChart.defaults.global.defaultFontColorOne color for all labels.
colorsArray[]It takes a set of values for each labels. If not specified, the default color.
minRadiusNumber35The minimum radius, in pixels, in which even the labels are displayed (for pie charts).

For example:

datasets: [
  {
    dataLabels: {           //  disabled by default
        colors: ['#fff', '#ccc', '#000'], //  Array colors for each labels
        minRadius: 30, //  minimum radius for display labels (on pie charts)
    }
  }
]

Please see JSBin: https://jsbin.com/joponil/4/edit

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago