我正在开发一个应用程序。此应用程序使用Chart.js显示一些甜甜圈图表。我试图用黄色填充甜甜圈“洞”。在甜甜圈洞里,我想放置一张图片。但是,我的努力没有成功。目前,我有以下内容,可以在此看到Fiddle。Chart.JS - 填充甜甜圈
var data = [{
value: 30,
color: "#F7464A"
}, {
value: 50,
color: "#E2EAE9"
}, {
value: 100,
color: "#D4CCC5"
}, {
value: 40,
color: "#949FB1"
}, {
value: 120,
color: "#4D5360"
}
]
var options = {
animation: false,
backgroundColor: [
'yellow'
]
};
//Get the context of the canvas element we want to select
var c = $('#myChart');
var ct = c.get(0).getContext('2d');
var ctx = document.getElementById("myChart").getContext("2d");
/*************************************************************************/
myNewChart = new Chart(ct).Doughnut(data, options);
如何定制甜甜圈填充?谢谢!
并http://www.chartjs.org/docs/#chart-configuration-patterns帮助里面的形象?可以为ya拨弄它,但这似乎做你想要的 – bryce