[英]Highchart line chart Tooltip showing index value instead of X-axis formatted label name
[英]Flot Chart Tooltip showing last date value of x-axis, not the current value
y轴和x轴的值很好,但是当我将鼠标悬停在该点时,它显示了X的最后一个值,Y的值也很好。 X具有日期值。 例如,如果我将鼠标悬停在Mar/2014
,工具提示会显示Feb/2014
,或者如果我将鼠标悬停在05/May/2014
,则工具提示会显示04/May/2014
。 X轴和Y轴上的值都很好,似乎只有工具提示才是问题。
tooltipOpts: {
content: function() {
return "%s: %x | %y"
},
shifts: {
x: -30,
y: -50
}
}
有什么方法可以操纵%x来增加一个值或其他值?
问题解决了。 我也在工具提示中添加了日期格式,就像在xaxis中一样。
tooltipOpts: {
content: function(){
return " %x | %y"
},
xDateFormat: timeFormat,
shifts: {
x: -30,
y: -50
}
}
在timeFormat中,您放置了一个类似var timeFormat = "%d/%b/%Y"
的字符串。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.