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 Query
- 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?
- *Highcharts* How to get the min and max value of the zoom box
- In highcharts, is it possible get the exact position of x axis labels for overlap detection purpose?
- Get the x axis range on selecting a zoom range in Highcharts
- HighCharts: Is it possible to remove every other value on the x-axis?
- Heatmap: Get related data of the hovered cell on mouseOver
- Strange character in the Highstock source code
- Highcharts xAxis padding is lost when navigator when zooming in and out and can't get the padding back when zoom out
- Why code of Horizonal line(y-axis) on a single in Highcharts get applied to all other charts integrated with Webdatarocks
- How to get highcharts dates in the x axis?
- HighCharts : Is it possible to customize the colors of individual series?
- How to get only whole numbers on the y-axis?
- Highstocks - How to change the default Zoom
- How can I get the max value of a y axis at highcharts?
- How to get Highcharts X-Axis Categories starting at the left most point
- Is it possible to position Highcharts dataLabels depending on the value?
- Highcharts Pie charts get the selected pie id
- Highcharts chart click event fired on click of the reset zoom button (bug?)
- How do I get the value of a highcharts graph point on mouseover?
- Highcharts - animations other than the default
- Export HighChart as an image in excel file together with the other page contents
- Is it possible to hide the line & symbol next to Highcharts legend items?
- Is it possible to hide the navigator in highcharts at runtime?
- highcharts link series such that turn one off turns off the other
- Change the zoom Type dynamically?
- how to get geojson of mainly cities of all of country of the world
- Is it possible in highcharts to have 2 charts, sharing the same x-axis, but next to one another?
More Query from same tag
- Conditionally show/hide Tooltip of Highcharter
- How to add horizontal scroll in Organization chart highcharts?
- Highcharts gauges not working in IE8
- How to Highcharts max height based on width of bars in chart
- Highcharts yaxis max
- How can I adapt a Highcharts graph to a responsive view
- Highcharts: Generate chart from tables having HTML tags in TD's
- Override tick interval calculation in Highcharts?
- Can we display a tooltip by default not by mouseover
- javascript highcharts jQuery issue
- How to set interval points on the x-axis in HighCharts?
- Programmatically change a chart title in highcharts
- Highcharts: How to set dataGrouping
- Is there any way to know whether a highchart DOM is complete rendered?
- Pass data in form of variable -Highcharts
- Highcharts - Providing different range value in positive and negative side for Y-axis
- Formatting Highcharts Series
- Highcharts area spline values have incorrect position on y-axis
- How can I dynamically enable/disable series tooltip based on point condition
- highcharts display in my render html page which i want to convert into PDF using wkhtmltopdf in rails
- Highcharts issues in add like 1/10 on top of the column chart
- Highcharts highstocks - candlestick graph has last value partially cut
- Can't bind to 'options' since it isn't a known property of 'chart'
- Drawing a line between 2 points in line chart using Highcharts?
- array and object handling in javascript for getting highchart json data
- HighCharts Bar graph: Showing Bar Value when hovering the mouse
- Columns of markers
- Highcharts : axis with multiple colour
- Show categories and remove numbers in Angular Gauge Highchart
- how to set visibility of div in controller (SAP UI5)