[英]Remove day name from highstock chart tooltip
You can change the standard dateTimeFormat
for the day* label this chart uses. 您可以更改此图表使用的日期*标签的标准
dateTimeFormat
。
* It might be you need to change something else as day
, depending on your chart content. *可能是您需要更改其他
day
,具体取决于图表内容。 See the dateTimeLabel API for all possibilities you can change. 有关可以更改的所有可能性,请参见dateTimeLabel API。
tooltip: {
dateTimeLabelFormats: {
day: '%b %e, %Y'
}
},
This changes the format to Mar 01, 2000
, for example. 例如,这会将格式更改为
Mar 01, 2000
。 If you want a different time format you can check out the PHP strftime
which Highcharts uses for their formatting as stated in their dateFormat API 如果您希望使用其他时间格式,则可以按照Highcharts的dateFormat API中所述的格式检查
PHP strftime
I guess you can achieve this by editing your tooltip format during the declaration. 我想您可以通过在声明期间编辑工具提示格式来实现此目的。
example of tooltip configuration 工具提示配置示例
tooltip: {
formatter: function() {
return '<b>' + this.series.name +'</b><br/>' +
Highcharts.dateFormat('%e %b %Y',
new Date(this.x))
+ ' date, ' + this.y;
}
},
You can also customize your X axis tooltip by using this doc : 您还可以使用以下文档来自定义X轴工具提示:
https://api.highcharts.com/highcharts/plotOptions.series.tooltip https://api.highcharts.com/highcharts/plotOptions.series.tooltip
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.