score:1
By default, Highcharts enforces to have ticks on round values. If you set the yAxis.min
or yAxis.max
to some value, that is not divisible by round tickInterval (e.g. 2, 5, 10, 20, 25, 50, 100), this value will be rounded to such.
There are some ways of setting ticks in the other way.
The most enforcing ones are to set the tickPositions
Array that strictly says, what the ticks should be on the given axis, or with tickFormatter
function, which returns the tickPositions Array.
Example code:
let data = [1500, 1400, 1550, 1630, 1600],
min = Math.min(...data),
mid = (Math.max(...data) - Math.min(...data)) / 2 + Math.min(...data),
max = Math.max(...data);
Highcharts.chart('container', {
yAxis: [{
tickPositions: [min, mid, max]
}],
series: [{
data: data
}]
});
Demo:
https://jsfiddle.net/BlackLabel/07kzt12x/
API References:
https://api.highcharts.com/highcharts/yAxis.tickPositions https://api.highcharts.com/highcharts/yAxis.tickPositioner
Source: stackoverflow.com
Related Query
- How to force start on min/max and prevent automatic rounding
- How do I force highcharts to pay attention to min and max on my secondary axis?
- *Highcharts* How to get the min and max value of the zoom box
- How to use Highchart auto calculated min and max values, unless they are above or below a predefined min and max
- How to change highcahrts min and max selection behavior?
- highchart- how do I hide y-axis, when y-axis is set with max and min limits
- How to get chart min and max values after Drag zooming in highChart chart?
- How to set min and max values for an axis?
- How to extract Min and Max date from Highcharter stock graph?
- Force Highcharts to use my min and max
- Highcharts - How to get Max and Min value between 2 dates
- I change the min and max of the xaxis, but how to i change the 'navigator'?
- How to format Highcharts columnRange to get json data for temperature Min and Max
- Highcharts: Set y Axis Max and Min dynamically, and not at creation
- How can i force Highcharts to use same symbols in Legend and Series?
- how to assign date time to highchart with intervals and date start
- High chart - Column Range Chart with Time range. How to get tooltip as Start and End time
- Highcharts series graph to start and end on tick and end on max
- How to start and end a dynamically generetad datetime highchart's xAxis on the first and last tick
- How do I prevent Highstock right range handle keep slipping off the max value when adding data
- Highstock, True way of Get count of shown points after setExtreme (Zooming) - WITHOUT counting all data with MIN and MAX
- How to display all dates with a given Start Date and End Date even if there is no data?
- Highchart Renderer By min and max
- How do I dynamically change the yAxis min, max and tickInterval in HighCharts
- Highchart Axis with only min and max series value
- HighCharts - Set Max and Min values in zoom reset
- highcharts div resize to min and max on click
- Highcharts -- how to change line width programmatically and prevent resetting line width?
- Setting Min and Max values for more than two Highchart Solid Gauges using function
- Force min/max in Highcharts and avoid 0 for min
More Query from same tag
- Highcharts with database
- Override table cell background color in highcharts-tooltip
- how to get each key and value from object in javascript for high chart graph
- Append data count onto different series
- Set Additional Data to highcharts series
- Highcharts: multiple series columns by year
- Highcharts export module: Multiple Phantom JS instance in jBoss
- Highcharts tooltip using HTML allows advanced formatting like images
- Dynamically updating a highcharts object after data refresh in React
- drilldown on column range
- Highchart js max 15 plots to be plotted
- Async DrillDown functionality in Highcharts with Angular 4
- high chart with large variates data and dynamically create y axis
- In Highstock v1.3.1 is there a way to detect setExtremes only on mouse up?
- Pass PHP result-set to JavaScript array in Highchart?
- Add new series to the top of a highcharts stacked column chart
- highcharts change chart type using dropdown for multiple series
- Overlapping of highchart with it's series text
- Highcharts, x Axis Label / Ticks after Breaks
- More Than 2 Y axis in Grafana
- Javascript event conflict, but not sure how to identify the first event assignment
- Individually colored data ranges in highcharts
- How to force Highcharts to show last label on xAxis?
- Highchart is not working when I am fetching the axis values from database
- How to find the radius of the piechart/donut chart
- Uncaught TypeError: Cannot set property 'custom/world' of undefined
- Highcharts: multiple heatmaps with shared color bar
- Enable or disable data labels shown in pie charts in Highcharts on click of a button
- Highcharts Spider Chart, change axis ranges
- Plot graph points as a live stream : Highcharts