我需要在我的网站上使用chars.js库中的四个图表 目前有一个图表的代码
$(function () {
$(".chart").drawDoughnutChart([
{value: volume, color: "#2980b9", text: volume},
{value: rest, color: "#d2d4d8", text: volume},
]);
volume = volume - 10; // For TEST filling
rest = rest + 10; // For TEST filling
});
(function ($, undefined) {
$.fn.drawDoughnutChart = function (data, options) {
var $this = this,
W = $this.width(),
H = $this.height(),
//other property include text under one chart
我应该为每张图表重复上述方法3次以上或最佳方式如何? 谢谢:))