javascript - highchart轴标签不能设置在标签的开头?
问题描述
我继续遇到 highchart 的问题。
我正在生成带有给定数据的图表。
我的 x 轴标签需要自定义,所以我传递了一组数组
xAxis: {
min: -3.5,
//catagories: [xaxis],
//type: 'linear',
tickInterval: 1,
//showFirstLabel: true,
//startOnTick: true,
labels: {
formatter: function () {
return xaxis[this.value];
},
//tickPositions: -3,
rotation: -90,
},
},
我环顾四周并尝试了很多事情,我做错了什么?标签从 0 开始,我需要它从图表的开头开始
解决方案
感谢@codeer,
xAxis: {
min: -3.5,
//catagories: [xaxis],
//type: 'linear',
tickInterval: 1,
//showFirstLabel: true,
//startOnTick: true,
labels: {
formatter: function () {
return xaxis[this.value+3];
},
//tickPositions: -3,
rotation: -90,
},
},
+3 确实解决了我的问题,我确实尝试过 -3,但从未尝试过 +3 .. 谢谢!
推荐阅读
- node.js - 如何使 Google 可调用函数只能在某些客户端应用程序上访问?
- python - 编辑电报机器人发送的消息中的文本而不发送另一条消息
- survival-analysis - 为什么考克斯模型高估了人群的风险?
- flutter - Flutter中Customscrollview和listviewbuilder的区别
- reactjs - Reactjs TypeError:render is not a function in contrxt-api with react-router-dom
- javascript - 使用 useEffect 时出现“,”预期错误
- android - 我如何告诉 Gradle 仅从特定的 aar 中选择给定的本机库
- html - 如何在不影响内容的情况下为可点击元素添加边框?
- nginx - 从 Google Apps 脚本连接时,间歇性 nginx 超时且未记录错误
- python - 无法在水平线上打印结果