Skip to content

bebraw/Chart.js.legend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.