0
ハイチャート - Plotbandに従って共有ツールチップを変更するのはちょっと難しいです。ハイチャート共通のツールチップ(ラインシリーズ用) - ホバリング時の変更
series: [{
name : 'one',
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
},{
name : 'two',
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
},{
name : 'three',
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
plotName : {'first','second','third'}
plotFrom : {'0','50','100'}
plotTo : {'49','99','149'}
条件:
1. On hovering over plotband - "first" tooltip should show value for series "one"
2. On hovering over plotband - "second" tooltip should show value for series "one" & "two"
3. On hovering over plotband - "third" tooltip should show value for series "one","two" & "three"
が本当にあなたの時間と助けに感謝。
マイコード:
ツールチップの一部:
tooltip:{
shared:true,
shadow: false,
useHTML: true,
backgroundColor: 'white',
formatter: function() {
var s = '<table><tr style="font-size:10px; font-face:verdana;"><td>Date: </td><td>'+ this.x +'</td></tr>';
$.each(this.points, function(i, point) {
+= '<tr style="font-face:verdana; font-size:10px; color:'+point.series.color+'"><td>'+ point.series.name +'</td><td>: '+point.y+'</td></tr>';
});
s += '</table>';
return s;
}
},
Plotbandパーツ:
for(var i=0;i<plotName.length;i++) {
chart.xAxis[0].addPlotBand({
color: band_Colors[i],
from: plotFrom[i],
to: plotTo[i],
label : {
useHTML: true,
text : plotVersion[i],
style : {
fontFamily : 'verdana'
}
}
});
}
誰も私を助けてくださいことができます。前もって感謝します。
ありがとうございます!上記のサンプルとは異なり - 私のシナリオでは、x値は 'Dates'とその" dynamic "です。 xの値を比較し、ツールヒントの値を制御する方法を教えてください。前もって感謝します – Disera