JavaScript之Chart.js图例(legend)

#html

<div id="chart_line_legend" class="chart-legend"></div>
<canvas id="chart_line" height="80"></canvas>

#js

// render chart
var ctx = document.getElementById("chart_line").getContext("2d");
chartLine = new Chart(ctx).Line(lineData, lineOptions);
document.getElementById('chart_line_legend').innerHTML = chartLine.generateLegend();

 

posted on 2016-09-03 21:03  燕君临  阅读(5936)  评论(0编辑  收藏  举报

导航