防止Highcharts重绘Axis的规模 [英] Prevent Highcharts to redraw Axis' scale

查看:122
本文介绍了防止Highcharts重绘Axis的规模的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一种方法可以防止Highcharts在添加新系列时重新计算和重新绘制Axis的比例。
我需要做的是以下内容:我有一个包含大量数据的散点图;当用户选择一个点时,我会添加一个线类型的新系列。这个系列的分数是前一个分数的一个有限的样本,所以没有添加真实的新分数,但是xAxis的比例发生了变化。
将xAxis的最小和最大值,startOnTick和endOnTick设置为true并不能解决问题。任何想法?




编辑:
正如我写的,Highcharts处理坐标轴的方式对我来说仍然是一种莫名的感受。就我而言,我在同一个画布上绘制了一个散点图和一个柱状图。为了响应用户点击,我添加了2个新系列:基于原始数据子集的系列系列和列系列。问题是由列图引起的:当您向列图添加新的系列时,条不会重叠,而是重新分配,从而创建缩放更改效果。

解决方案

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


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.

解决方案

Try to create the line series but hidden, and when you want to show it use chart.series[1].show().

这篇关于防止Highcharts重绘Axis的规模的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆