简体   繁体   中英

Prevent Highcharts to redraw Axis' scale

I was wondering if there is a way to prevent Highcharts from recalculating and redrawing the scale of the Axis when I add a new serie. What I need to do is the following: I have a scatter chart with a lot of data; when the user selects a point, I add a new series with a "line" type. This series' points are a limited sample from the previous ones, so no "real" new points are added, but the scale of the xAxis changes. Setting xAxis' min and max value, startOnTick and endOnTick to true did not solve the problem. Any idea?


Edit: As I wrote, the way Highcharts handles axis' scales is still a mistery to me. In my case, I was rendering one scatter and one column graph on the same canvas. In response to a user click, I was adding 2 new series: a line serie and a column serie each one based on a subset of the original data. The problem was caused by the column graph: when you add a new serie to a column graph, bars are not overlapped, but redistributed, thus creating the scale change effect.

尝试创建但隐藏的线系列,并在要显示它时使用chart.series [1] .show()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM