悬停图形的一部分(donught)后,我需要进行回调。我怎样才能做到这一点?从理论上讲,Chart.js 不提供回调,所以这是一个问题 :)
我当前的代码:
var visitorsChart = [
{
value: 60,
color:'#3e89dc'
},
{
value: 40,
color:'#88c600'
}
]
var visitorsChartOptions = {
percentageInnerCutout: 70
}
var renderVisitorsChart = new Chart(document.getElementById("visitors-chart").getContext("2d"), {tooltips: {position: 'bottom left', background: 'rgba(255,255,255,0)', fontFamily: 'Open Sans', fontSize: '40px', fontWeight: '700', labelTemplate:'<%=value%>'}, border: {width:0}, showShadow: false}).Doughnut(visitorsChart, visitorsChartOptions);