Highchart js max 15地块被绘制 [英] Highchart js max 15 plots to be plotted

查看:124
本文介绍了Highchart js max 15地块被绘制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如果我获得超过15天的时间我必须减少数据并将其显示给用户15天的数据,以便用户可以在不拥挤数据的情况下查看数据。最多90天将在系列中给出,我必须减少到15天。



请在我的当前代码中检查 http://jsfiddle.net/MULZL/

任何人都可以给我一个解决方案吗?

PS:我不想把它缩小到前15天或最后15天。我想这样做只是因为在图表中90天看起来拥挤,我不希望缩放功能应用。我希望解决方案忽略一些数据(天),如果它超过15天,15天内解决问题。

您可以尝试 dataGrouping highStock的特点

  var dataGrouping = {
groupPixelWidth:40,
units:[[$ b $''',
[1,2,3, 4,5,6]
]]
};

Highcharts将确保您的所有列至少具有指定的宽度(40) coulmns很大,所以不可能有这个宽度,它会使用单位对数据进行分组,所以它会将1天的数据分为1列或2天分为1列,等等。
不确定是否真的需要15个绘图,但我认为您关心的是避免拥挤数据,这确实如此,但列数将根据您指定的宽度,plotArea的宽度并允许单位及其倍数。根据您的数据和图表宽度调整值。
jsFiddle


I have been trying a lot in Highchart js and still cant find a way to reduce the number of elements in the series.

If i get more than 15 days data i have to reduce it back and show to user as 15 days data so that user can see the data without crowding of data. Max 90 days will be given in the series which i have to reduce to 15 days.

check my current code here in http://jsfiddle.net/MULZL/

can any one give me a solution for it ?

P.S: I dont want to reduce it to first 15 days or last 15 days. I want to do it just because getting 90days in the chart looks crowded and i dont want zoom functions to apply. I want the solution for ignoring some data (days) to make it 15days if it is more than 15 days

解决方案

You can try dataGrouping feature of highStock

var dataGrouping = {
    groupPixelWidth: 40,
    units: [[
        'day',
        [1, 2, 3,4,5,6]
        ]]
};

Highcharts would make sure all your columns are at least the specified width (40), if the number of coulmns is large, such that it's not possible to have that width, it will group data using the units, so it will group data of 1 day into 1 column or 2 days into 1 column and so on. Not sure if you really want exactly 15 plots, but I think you concern was to avoid crowding of data, this does exactly that, but the number of columns will vary based on the width you specify, the width of the plotArea and allowed units and its multiples. Tweak the values as per your data and width of your chart. jsFiddle

这篇关于Highchart js max 15地块被绘制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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