How to add labels into Chart.js canvas plugin?

I'm using the awesome plugin [**Chart.js**][1], and I'm trying to find the way of display labels within each percentage. So I googled it, and I found this pull: I did a simple fiddle to test it, but doesn't works: **** This is the content: **HTML** **JS** $(document).ready(function () { var pieData = [{ value: 30, color: "#F38630", label: 'HELLO', labelColor: 'black', labelFontSize: '16' }, { value: 50, color: "#E0E4CC" }, { value: 100, color: "#69D2E7" }]; var myPie = new Chart(document.getElementById("canvas").getContext("2d")).Pie(pieData, { labelAlign: 'center' }); }); ---------- I'm afraid there is no information about this in the [documentation][2]. Also I'd like to know how to display a label for each portion, but outside the chart. Linked by a line. As do the charts of [highcharts.js][3]. By the way, I'd be glad if you recommend me an html5 chart alternative which includes the options I said above. I've heard about the [flot][4] plugin, but I'm afraid does not support animations... If you need more info, let me know and I'll edit the post. [1]: [2]: [3]: [4]:
From that pull you posted - It appears it is not in the master branch but that guys fork.

以上就是How to add labels into Chart.js canvas plugin?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准