Skip to content

Plugin for chartist.js library that automatically creates rotated labels for pie charts

License

Notifications You must be signed in to change notification settings

nmushkin/chartist-rotated-pie-labels

Repository files navigation

Rotated Pie Labels For Chartist.js

This plugin allows you to create automatically rotated labels for slices of chartist.js pie charts

If something is broken, please send a PR! I don't have a great understanding of node environments, etc and would love the help. Thanks

Example Usage:

new Chartist.Pie('#pie-chart', {
    series: mySeries,
    labels: myLabels
  }, 
  {
    donut: true,
    showLabel: true,
    plugins: [
      Chartist.plugins.ctRotatedPieLabels({
        labelTranslate: .95,
        outerAnchor: true
        })
    ]
  });

Options:

  1. labelTranslate
  • The amount that labels will be translated out from the center of the pie. Default: .95
  1. outerAnchor
  • If set to false, the labels will be anchored inside-facing. Default: true

About

Plugin for chartist.js library that automatically creates rotated labels for pie charts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages