javascript - Set Y value in pixels in amchart
问题描述
I have a chart with icons that are drawn as a simple line with bullets. The data is like this [["18-07-2021",64], ["19-07-2021",64],["20-07-2021",64], .... ] I manually set the Y value as 64 (max data value). But I want to set this line with icons in pixels offset from the top border of the chart, so it was always on the same height(now when the data changes the Y char max value changes). Is there a way to do so? Thanks.
解决方案
您可以使用最小值/最大值来添加最大值和图表顶部之间的差距。例如:
valueAxis.min = 0;
valueAxis.max = 130;
valueAxis.strictMinMax = true;
请参阅https://www.amcharts.com/docs/v4/reference/valueaxis/#max_property中的文档
推荐阅读
- git - 如何使用 git stash apply 应用多个存储
- python - 如何与海龟画布/屏幕尺寸正确交互?
- javascript - React Navigation 6 - 自定义标题高度
- ios - iOS 客户端 - GraphQL 服务器文件上传只接收一个字符串
- node.js - NodeJS 和 SQL Server:在 Docker 容器中时无法连接
- vue.js - Vuex:从对象导入单个状态
- reactjs - 更新节点 js 后,npm install 不工作
- php - 使用 URL 过滤 Google Analytics API
- javascript - 在 javascript 中使用超过 1 个播放器时阻止 YouTube api 启动
- python - 使用 paho 和 TLS 连接到 MQTT 代理失败