Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 1.28 KB

README.md

File metadata and controls

34 lines (23 loc) · 1.28 KB

DEPRECATED Please use the official Chart.js legend instead.

Chart.js.legend

An implementation of legend widget for Chart.js.

Simply legend(parent, data). See demo.js for a full example.

If you need to support older browsers (IE8 and such), use src/legend.legacy.js. Otherwise you can stick with src/legend.js.

Quick example

<div id="placeholder"></div>
var data = ...;  // refers to the charts data
legend(document.getElementById('placeholder'), data);

Contributors

  • Laurent Goussard - Simplified markup, support for pie etc.
  • yousifucv - Make CSS border work properly
  • KuenzelIT - Update to support new Chart.js syntax and add example
  • Antonin Bourguignon - Make it easier to customize legend color samples
  • Xu Ding - IE8 and lower compatible version (legend.legacy.js)
  • Alex Belloni - If a chart has tooltips, show legends there
  • TLevasseur - Allow legends to be templated. Handy for formatting.

License

MIT.