2017-06-05 58 views
0

我試圖 Chart JS custom tooltip option?How to show tooltips in Chart.js?如何獲取chart.js v1.x上的工具提示?

一礦的許多嘗試中有:

new Chart(document.getElementById("location").getContext("2d")).Bar(barChartData2,{ 
    showTooltip: true, 
    tooltipTemplate: "<%= value %>", 
    //Option for title font size in pixels 
    tooltipTitleFontSize: 14, 

    //Option for tooltip title color 
    tooltipTitleFontColor: "#eee", 
    }); 

但都沒有用的,我,我已經試過各種可能性的,我不能夠知道什麼是阻止工作提示工作。 沒有出現在控制檯調試所以任何建議將感謝

+0

我是一個新手,所以它會花我幾天的時間來學習使我的程序小提琴@ℊααndnd – Kobey24

+0

對我來說最好的事情是改變到新版本,它需要我幾天來修復項目,但我認爲這會在稍後有所幫助。 – Kobey24

回答

0
new Chart(document.getElementById("location").getContext("2d")).Bar(barChartData2**)**,{ 
showTooltip: true, 
tooltipTemplate: "<%= value %>", 
//Option for title font size in pixels 
tooltipTitleFontSize: 14, 

//Option for tooltip title color 
tooltipTitleFontColor: "#eee", 
}); 

見上面的代碼....是否缺少barChartData2後一個括號?

+0

OMG我怎麼能忘記?哦,我想我是把第二個對象作爲json傳遞給函數,所以不需要事先關閉它 – Kobey24

相關問題