简体   繁体   English

设置自定义rangeSelector并在具有Highstock的图表和导航器上禁用xAxis标签

[英]Set a custom rangeSelector and disable xAxis label on chart and on Navigator with Highstock

I'm using highstock with lazy-loading like in this demo , i'm using 2 different series: both have a "time" parameter but none of them should have a date-time xAxis. 我在这个演示中使用了带有延迟加载的highstock,我使用了2个不同的序列:都具有“时间”参数,但是它们都不应该具有日期时间xAxis。

Each series has a structure like this: 每个系列的结构如下:

serie1:[{"x" => 1, "y" => value_1, "time" => time_of_point_1},
        {"x" => 2, "y" => value_2, "time" => time_of_point_2},
        ....
        {"x" => n, "y" => value_n, "time" => time_of_point_n}];


serie2:[{"x" => 1, "y" => value_1, "z" => value_z_1, "time" => time_of_point_1},
        {"x" => 2, "y" => value_2, "z" => value_z_2, "time" => time_of_point_2},
        ....
        {"x" => n, "y" => value_n, "z" => value_z_n, "time" => time_of_point_n}];

My goal it to have a custom rangeSelector that zoom the chart according to the time parameter that each point has. 我的目标是拥有一个自定义的rangeSelector,它可以根据每个点的时间参数来缩放图表。

So my questions are: 所以我的问题是:

Is possible to have a custom rangeSelector that zoom on chart according to a point parameter different from x and y values?: 可以有一个自定义的rangeSelector来根据不同于x和y值的点参数来放大图表吗?

let's say: 比方说:

 events:{
    if (e.trigger == "rangeSelectorButton" && 
        e.rangeSelectorButton.text == "last 3 hours"){
        // zoom on chart and set the chart
        // with all point that has "time" parameter 
        // between now and the last three hours
    }
}

Than I'm looking to a way to disable X Axis label to make all more readable. 我正在寻找一种方法来禁用X轴标签,以使所有标签更具可读性。

I'm trying to disable the label on chart xAxis and on Navigator xAxis too but no matter what it shows up every time. 我也尝试禁用图表xAxis和导航器xAxis上的标签,但是无论每次显示的内容如何。

I used this code on both: 我在两个代码上都使用了此代码:

xAxis : {
    label: {
       enabled: false
    }
}

but it doesn't work. 但这不起作用。

Any advices? 有什么建议吗?

You have two ways: 您有两种方法:

In the xAxis it should be labels, instaed of label: 在xAxis中,它应该是标签,标签为insta:

xAxis : {
    labels: {
       enabled: false
    }
}

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

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