score:1
Accepted answer
You can use setExtremes
event callback function and update tick interval based on min
and max
values.
xAxis: {
type: 'datetime',
events: {
setExtremes: function(e) {
const interval = (e.max - e.min) / 6;
this.update({
tickInterval: interval
}, false);
}
}
}
You can also consider using minTickInterval
or tickPixelInterval
.
Live demo: http://jsfiddle.net/BlackLabel/d1Lbj9xh/
API Reference:
https://api.highcharts.com/highcharts/xAxis.events.setExtremes
https://api.highcharts.com/highcharts/xAxis.minTickInterval
https://api.highcharts.com/highcharts/xAxis.tickPixelInterval
Source: stackoverflow.com
Related Articles
- Is it possible to get a statechange of the zoom or other zoom-related parameters in order to dynamically set tickInterval in Highcharts?
- Highcharts - Possible to change the text zoom to other wording?
- Possible to connect the zoom on two Highcharts graphs?
- Is it possible to position the zoom buttons in highcharts/highstock?
- Is possible to zoom with mouse in Highcharts?
- HighCharts: Is it possible to remove every other value on the x-axis?
- Strange character in the Highstock source code
- highcharts - is it possible to zoom pie charts
- How to stop resetting zoom when switches to other chart type in highcharts
- How can I add double related x-axis bar to high chart in zoom
- Why code of Horizonal line(y-axis) on a single in Highcharts get applied to all other charts integrated with Webdatarocks
- Possible to highlight without zoom in Highcharts?
- Is it possible to sync zoom between two scatter highcharts?
- Is possible to set min and max zoom in Time series Highcharts?
- HighCharts : Is it possible to customize the colors of individual series?
- Highstocks - How to change the default Zoom
- highcharts hide zoom reset button, call zoom reset programmatically
- Highcharts - show every other x-axis category
- How do I detect a zoom event in highcharts?
- HighStock : Remove Zoom bar
- Is it possible to position Highcharts dataLabels depending on the value?
- Is it possible to use R Plotly library in R Script Visual of Power BI?
- Highcharts chart click event fired on click of the reset zoom button (bug?)
- Optimize JavaScript DrillDown code
- hide zoom text on rangeSelector
- Highcharts - animations other than the default
- Execute function after zoom highcharts
- highcharts how to catch and insert logic in click reset zoom button event
- Calling Reset Zoom manually
- Possible to use xAxis with type "datetime" and yAxis with categories?
- How to Show Highchart on popup page [triggered by button]
- How to tell if series is in upper chart or lower chart in tooltip (using highstock)?
- Highcharts not displaying anything just blank html page
- Template helper not ready even though it should be
- ReactErrorUtils.invokeGuardedCallback in React fires event repeatedly in IE browser
- highcharts-export-clientside Unsupported export format
- Highcharts Change Bar Color Based on Value
- Inverted Link chart- Highcharts
- How can I highlight USA using Highcharts without highlighting Alaska?
- Moving from highcharts 3.0 to 4.0: grouped column weird behavior
- Draw small symmetrical arc line path between two markers on world map in Highmaps
- The continuous update highcharts with more data plotting the continuity is not visible so we need that continuity in the centre of the graph
- Highcharts draggable columns and set value by click
- Testing for NaN in a JS array?
- DotNet.Highcharts ChartTypes reference?
- stop auto adjusting scale in highcharts
- How can i change symbol in tooltips on a chart? HIGCHARTS
- WebPack and Require
- Heat map with time line
- How to set min and max values for an axis?