highcharts:y轴的其他设置。处理大量数据 [英] highcharts: Other settings for y-axis. Dealing with large numbers

查看:348
本文介绍了highcharts:y轴的其他设置。处理大量数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在y轴上结合小数字来管理/绘制大数字时遇到了一些困难。



这里的示例是针对y轴类型: http://jsfiddle.net/index/6FBec/1/



对于第一张图(线性):问题在于小数字在底部几乎平坦地绘制。



第二个图(对数):当这里(这实际上更好),当大数量变得太大时,下一个滴答的差距就很远(图2的最后一点12,250和最大的y轴是100,000)。问题是,是否有不同的Y轴类型,或者我怎样才能做类似线性的事情,但是如果有太大的事情会做类似于对数的事情,例如使用较小的间隙首先然后增长。



PS:不介意0.1的价值。 Temp为对数不想要0值。

解决方案

我已经使用了一些数学方程来减少点之间的差距,图形差异。为此,我在服务器上处理数据,并且如果某个点与另一个点有很大不同,那么我将使用它们的平方根。这里有几个例子可以证明这一点:

VALUES:220,110,55,5
$ b



VALUE:1100,220,110,55,5





数据以平方根发送至小数点后第三位。然后我使用yAxis标签上的格式化程序和工具提示来显示正确的值。另外,我使用 parseInt 确保标签显示为整数。


I am having some difficulty trying to manage/plot out large numbers in the y-axis in combination with small numbers.

Example's are here for both y-axis types: http://jsfiddle.net/index/6FBec/1/

For the first graph (linear): The problem's are that the small numbers gets plotted almost flat on the bottom.

For the second graph (logarithmic): Where as here (this is actually better), when the large number gets too large, the gap for the next tick is way far (graph2 last point 12,250 and largest y-axis is 100,000).

Question is, is there a different y-axis type or how can I do something like linear but when there is something too big it would do something like logarithmic like using smaller gaps on first then growing.

PS: Don't mind 0.1 value. Temp for logarithmic not wanting 0 values.

解决方案

I have Used some mathematic equations to reduce the gaps between points and still show the relative difference graphically. To do this I process the data on the server and if a point is drastically different than another, then I will use a square root of both of them. Here is a couple of examples that demonstrate this:

VALUES: 220, 110, 55, 5

VALUES: 1100, 220, 110, 55, 5

The data is sent as the square root rounded to the third decimal. Then I use the formatter on the yAxis label and tooltip to display the proper values. Also, I am making sure that the label displays as a whole number by using parseInt.

这篇关于highcharts:y轴的其他设置。处理大量数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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