我想当我悬停点时,它会显示多个工具提示,就像下方图像一样。
我也在向下显示我的代码。
<div class="col-sm-6"> <!-- My Html Code -->
<h4 class="heading">Aylık Tıklanma ve Görüntülenme</h4>
<canvas id="myLineChart" width="300" height="250"></canvas>
</div> <!-- My Html Code -->
<div class=""> <!-- My JS-Php Code -->
<script type="text/javascript">
var canvas = document.getElementById('myLineChart');
new Chart(canvas, {
type: 'line',
data: {
labels: ["<?php echo ayGetir("-11"); ?>","<?php echo ayGetir("-10"); ?>","<?php echo ayGetir("-9"); ?>","<?php echo ayGetir("-8"); ?>","<?php echo ayGetir("-7"); ?>","<?php echo ayGetir("-6"); ?>","<?php echo ayGetir("-5"); ?>","<?php echo ayGetir("-4"); ?>","<?php echo ayGetir("-3"); ?>","<?php echo ayGetir("-2"); ?>","<?php echo ayGetir("-1"); ?>","<?php echo ayGetir("now"); ?>"],
datasets: [{
label: 'Tıklanma',
yAxisID: 'A',
data: ["<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-11")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-10")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-9")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-8")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-7")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-6")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-5")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-4")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-3")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-2")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-1")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("now")); ?>"],
backgroundColor: "rgba(0,255,0,0.2)",
pointBorderColor: "rgba(75,192,192,1)",
pointHoverBackgroundColor: "rgba(75,192,192,1)",
pointRadius: 4,
}, {
label: 'Görüntülenme',
yAxisID: 'B',
data: ["<?php echo impGetir($connectDb,$userr,aySayiGetir2("-11")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-10")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-9")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-8")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-7")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-6")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-5")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-4")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-3")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-2")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-1")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("now")); ?>"],
backgroundColor: "rgba(255,255,0,0.4)",
pointRadius: 4,
pointBorderColor: "rgba(75,192,192,1)",
pointHoverBackgroundColor: "rgba(75,192,192,1)",
}]
},
options: {
scales: {
yAxes: [{
id: 'A',
type: 'linear',
position: 'left',
}, {
id: 'B',
type: 'linear',
position: 'right'
}]
}
}
});
</script>
</div><!-- My JS-Php Code -->
但我想像第一张图片一样,因为我的另一点并没有表现出来。(它留在后面)
如果你知道怎么做,我需要你的帮助。谢谢你的帮助..
答案 0 :(得分:0)
<强>解决强>
解决方案在这里;
<div class=""> <!-- line chart -->
<script type="text/javascript">
var canvas = document.getElementById('myLineChart');
new Chart(canvas, {
type: 'line',
data: {
labels: ["<?php echo ayGetir("-11"); ?>","<?php echo ayGetir("-10"); ?>","<?php echo ayGetir("-9"); ?>","<?php echo ayGetir("-8"); ?>","<?php echo ayGetir("-7"); ?>","<?php echo ayGetir("-6"); ?>","<?php echo ayGetir("-5"); ?>","<?php echo ayGetir("-4"); ?>","<?php echo ayGetir("-3"); ?>","<?php echo ayGetir("-2"); ?>","<?php echo ayGetir("-1"); ?>","<?php echo ayGetir("now"); ?>"],
datasets: [{
label: 'Tıklanma',
yAxisID: 'A',
data: ["<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-11")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-10")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-9")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-8")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-7")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-6")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-5")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-4")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-3")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-2")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("-1")); ?>","<?php echo clickGetir($connectDb,$userr,aySayiGetir2("now")); ?>"],
backgroundColor: "rgba(0,255,0,0.2)",
pointBorderColor: "rgba(75,192,192,1)",
//pointHoverBackgroundColor: "rgba(75,192,192,1)",
pointRadius: 4,
fill: false
},
{
label: 'Görüntülenme',
yAxisID: 'B',
data: ["<?php echo impGetir($connectDb,$userr,aySayiGetir2("-11")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-10")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-9")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-8")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-7")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-6")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-5")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-4")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-3")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-2")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("-1")); ?>","<?php echo impGetir($connectDb,$userr,aySayiGetir2("now")); ?>"],
backgroundColor: "rgba(255,255,0,0.4)",
pointRadius: 4,
pointBorderColor: "rgba(75,192,192,1)",
//pointHoverBackgroundColor: "rgba(75,192,192,1)",
fill: false
}]
},
options: {
tooltips: { // this code
mode: 'label', // this code
}, // this code
scales: {
yAxes: [{
id: 'A',
type: 'linear',
position: 'left',
}, {
id: 'B',
type: 'linear',
position: 'right'
}]
}
}
});
</script>
</div>