Chart.js - 饼图和圆环图的图表数据(Chart.js - In Graph Data for Pie & Doughnut Charts)
我需要在图表上显示数据。 就像这个设计一样,Chart.js有可能吗? 或者可能有一个扩展名吗?
I need to display data on a chart. Like on this design Is it possible with Chart.js? Or maybe there is an extension for this?
原文:https://stackoverflow.com/questions/34636707
更新时间:2020-02-25 07:59
最满意答案
您可以使用Chart.js在设计中生成图表。
var data = [
{
value: 20,
color:"#F7464A"
},
{
value: 13.3,
color: "#46BFBD"
},
{
value: 6.7,
color: "#FDB45C"
},
{
value: 6.7,
color: "#FDB45C"
},
{
value: 6.7,
color: "#FDB45C"
},
{
value: 46.6,
color: "#FDB45C"
}
]
var options =
{
animation: false,
tooltipTemplate: "%",
tooltipFillColor: "rgba(0,0,0,0)",
tooltipFontColor: "rgba(1,1,1,1)",
tooltipCaretSize: 0,
tooltipFontStyle: "bold",