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
.
<div id="placeholder"></div>
var data = ...; // refers to the charts data
legend(document.getElementById('placeholder'), data);
- 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.
MIT.