The legend is part of the standard parameters of the ChartJs library. Therefore, you do not need to explicitly add it as an option.
The library generates HTML. It is just a matter of adding this page. For example, add it to the innerHTML of the given DIV. (Edit the defaults if you are editing colors, etc.)
<div> <canvas id="chartDiv" height="400" width="600"></canvas> <div id="legendDiv"></div> </div> <script> var data = { labels: ["January", "February", "March", "April", "May", "June", "July"], datasets: [ { label: "The Flash Speed", fillColor: "rgba(220,220,220,0.2)", strokeColor: "rgba(220,220,220,1)", pointColor: "rgba(220,220,220,1)", pointStrokeColor: "#fff", pointHighlightFill: "#fff", pointHighlightStroke: "rgba(220,220,220,1)", data: [65, 59, 80, 81, 56, 55, 40] }, { label: "Superman Speed", fillColor: "rgba(151,187,205,0.2)", strokeColor: "rgba(151,187,205,1)", pointColor: "rgba(151,187,205,1)", pointStrokeColor: "#fff", pointHighlightFill: "#fff", pointHighlightStroke: "rgba(151,187,205,1)", data: [28, 48, 40, 19, 86, 27, 90] } ] }; var myLineChart = new Chart(document.getElementById("chartDiv").getContext("2d")).Line(data); document.getElementById("legendDiv").innerHTML = myLineChart.generateLegend(); </script>