I am unable to get the tickinterval to update in the following Jsfiddle: https://jsfiddle.net/rarwarrar/5xgoqjst/4/
Currently this:
xAxis: {
events: {
setExtremes: function(e) {
if (e.rangeSelectorButton.text === "2Hour") {
$('#chart').highcharts().xAxis[0].tickInterval= 2700000 //45 min
$('#chart').highcharts().redraw()
}
}
}
},
Is not working.
For instance can the tick interval be set to every 45 minutes once '2hour' is clicked?
You can use tickPositioner function for changing your tick positions after you set your extremes. You can use Axis.update() for updating tickPositions of this axis:
Here you can see an example how it can work: https://jsfiddle.net/5xgoqjst/5/
You should be able to change your tickPositions on different ranges as well.
Best regards.
You can, but that would be confusing to have text read "2hour" but actual time be 45 minutes. Why not add new button for this? In order for this to show there needs to be a minimum number of points but you can override with
allButtonsEnabled
. Here is what yourrangeSelector
could look like:And here is a live demo of it.
Maybe this could help someone, I updated an existing Fiddle ;-)
Then you will have to adapt it to your case of course.