0
我如何到達ChartJS只返回圖上點(在鼠標上)的值而不是整個數據集?圖表JS - 單行(點)工具提示
<table>
<tr>
<td>
<div style="width:30%">
<div>
<canvas id="canvas" height="600" width="1000"></canvas>
</div>
</div>
</td>
<td style="text-align:center;"><div id="placeholder" height="450" width="600"></div>
<script>
var lineChartData = {
labels : [<?php echo $_SESSION['GRAFICO2']; ?>],
datasets : [<?php echo $_SESSION[$_GET['vGrafico']]; ?>
]
}
window.onload = function(){
var ctx = document.getElementById("canvas").getContext("2d");
window.myLine = new Chart(ctx).Line(lineChartData, {bezierCurve: false, pointDot : true, datasetStroke : true, showTooltips: true, pointHitDetectionRadius : 2, offsetGridLines : true, TooltipTemplate: "<%= label %> - <%= data %>"});
legend(document.getElementById('placeholder'), lineChartData);
}
</script>
像這樣 now - than