Amcharts candle stick minimal grid step

强颜欢笑 提交于 2019-12-25 09:14:03

问题


I use Amcharts (not Amstock) to build candlestick charts. OHLC data is prepared by internal API based on selected timeframe on a web page. E.g., when "5 seconds" timeframe is selected, candlestick chart with candles for every 5 seconds is plotted.

When I zoom in this chart, I see that vertical grid lines number may be increased at some point (I've recently asked about a solution and started using minimalHorizontalGap option). What I want to achieve now is the following: vertical grid lines show never be narrower than selected timeframe. I.e., if 5s timeframe is selected, there should NOT be grid step less than 5s.

As a solution, grid lines may be tied to candles, because now sometimes grid lines lies around 10px from candle, which makes it looking not so good.

Thanks in advance for any help and workarounds!

P.S. just for reference some key parts of my amcharts config which may affect current behavior:

"categoryAxesSettings": {
  "minPeriod": "fff", // set minimum to milliseconds
  "groupToPeriods": ['fff', 'ss'] // specify period grouping
},
"categoryAxis": {
  "minPeriod": (timespan == "0.5" ? '500fff' : "1ss"),
  "parseDates": true,
  "minHorizontalGap": 45,
},  

来源:https://stackoverflow.com/questions/38958446/amcharts-candle-stick-minimal-grid-step

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!