highcharts - 我如何在 highcharts 的工具提示中设置 xAxis 的实际值
问题描述
我得到xAxis
标签的位置tooltip
xAxis
我需要标签的实际值,tooltip
即月份(Jan-20、Feb-20 等)。
这是我的代码:https ://jsfiddle.net/hze8r4go/10/ ,我做错了什么?
解决方案
而不是点格式化程序使用以下
formatter:function () {
console.log(this);
const template ="<span style='color:'"+this.points[0].color+"'>"+this.x+" : "+this.y+"</span>";
console.log(template)
return template;
},
在上面的代码中使用它并访问剩余值并构建所需的 HTML 模板并返回。
推荐阅读
- java - 如何使用Java在多个线程中复制文件
- amazon-web-services - 如果部署失败,Kubernetes 预删除钩子会阻止 helm 删除
- react-native - 由于我不知道在哪里引用视频或在哪里调用视频视图,我该如何处理此错误
- docker - 我可以从 dockerfile 中的 docker Image 中复制目录吗?
- function - perl:如何在函数中传递一个字符串和 2 个哈希?
- sql-server - SQL Server 数据库无法在不同的 PC 上运行
- linux - 如何删除电子邮件中包含三个以上点的行?
- c# - 如何存储对二维数组元素的引用?
- javascript - 如何根据用户的点击使特定选项卡在下一页上处于活动状态?
- ionic3 - 离子 3 中不显示图像