使用Chart.js庫V.2時,我想在將鼠標懸停在條形圖上時將光標更改爲'not-allowed'。Chart.js庫V.2將光標更改爲不允許
這裏是我的代碼
// Draw Chart
var ctx = document.getElementById("main").getContext("2d");
ctx.canvas.width = calculatedWidth;
ctx.canvas.height = calculatedHeight || 400;
mainDashboardChart = new Chart(ctx, {
type: 'bar',
data: dashboardDatas,
yLabels: 0,
options: dashboardOptions('noSubChart', suggestedMaxVal, subChartDataLength)
});
我無法找到一個方法來做到這一點。有人知道這是否可能?
您是否嘗試過使用CSS這個?像#main {cursor:not-allowed;} – CodeMonkey
然後整個畫布將獲得該屬性,而不僅僅是活動圖表區域。 –