问题
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