简体   繁体   English

防止Highcharts重新绘制Axis的比例

[英]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. 我想知道添加新的系列时是否有一种方法可以防止Highcharts重新计算和重绘Axis的比例。 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. 该系列的点是前一个点的有限示例,因此未添加任何“真实”新点,但是xAxis的比例发生了变化。 Setting xAxis' min and max value, startOnTick and endOnTick to true did not solve the problem. 将xAxis的最小值和最大值,startOnTick和endOnTick设置为true不能解决问题。 Any idea? 任何想法?


Edit: As I wrote, the way Highcharts handles axis' scales is still a mistery to me. 编辑:正如我写的那样,Highcharts处理轴比例的方式对我来说仍然是个迷。 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()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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