[英]Set a custom rangeSelector and disable xAxis label on chart and on Navigator with Highstock
我在這個演示中使用了帶有延遲加載的highstock,我使用了2個不同的序列:都具有“時間”參數,但是它們都不應該具有日期時間xAxis。
每個系列的結構如下:
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}];
我的目標是擁有一個自定義的rangeSelector,它可以根據每個點的時間參數來縮放圖表。
所以我的問題是:
可以有一個自定義的rangeSelector來根據不同於x和y值的點參數來放大圖表嗎?
比方說:
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
}
}
我正在尋找一種方法來禁用X軸標簽,以使所有標簽更具可讀性。
我也嘗試禁用圖表xAxis和導航器xAxis上的標簽,但是無論每次顯示的內容如何。
我在兩個代碼上都使用了此代碼:
xAxis : {
label: {
enabled: false
}
}
但這不起作用。
有什么建議嗎?
您有兩種方法:
在xAxis中,它應該是標簽,標簽為insta:
xAxis : {
labels: {
enabled: false
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.