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 Articles
- How to force start on min/max and prevent automatic rounding
- Prevent source to load twice
- Strange character in the Highstock source code
- Highcharts multiple series force xAxis start point
- How to prevent my stacked series from being in reverse order?
- Highcharts, make the yAxis start at zero
- Rounding results in highcharts jquery script
- How can I force multiple y-axis in Highcharts to have a common zero
- How to prevent highcharts from shortening labels with ellipsis
- Highcharts - Force Categories in x-axis to be shown, even without data
- Optimize JavaScript DrillDown code
- Highcharts - How to start x axis from an arbitrary value
- How to prevent column overlap in Highcharts
- Replacing highcharts.each in my code as it is being deprecated
- Setting Highcharts maximum Y value to an exact amount without rounding
- How can I force highcharts to show every x-axis label regardless of spacing constraints?
- In Highchart legend, Want to bring checkbox at start
- Highcharts remove gap between start of xAxis and first value
- Highcharts force to 0 before climbing again
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Code works on fiddle but not when I do /show
- How can i force Highcharts to use same symbols in Legend and Series?
- Force Highcharts to display tooltip outside of div/container
- Highcharts - Global configuration with common code and unique data & Headings
- how to assign date time to highchart with intervals and date start
- How can I prevent my HighChart bar chart from being inverted?
- High chart - Column Range Chart with Time range. How to get tooltip as Start and End time
- JavaScript code inside TypeScript file .ts not working
- How to force Highcharts to show last label on xAxis?
- How do I prevent Highcharts from truncating categories?
- enable disable hover in highchart.stock
- Bootstrap+HighCharts.js Responsive Image Position in Donut Chart
- How to plot the X axis data point for uneven tick interval at in Highcharts
- Implementing High charts with PHP and Mysql
- Adding data to Highcharts after initial rendering
- HighCharts image export
- Highchart + Plotly dash Graph displaying before pressing the button
- Using Highcharts library in swing application
- Show Highcharts tooltip at the bottom of the chart in responsive mobile version
- HighStock Chart: Extract time based on user selection from the Navigator window
- HighCharts: How to combine custom colors with gradient
- issue on Adding Multi Text To Chart in Highcharts
- highcharts with scrollbar, how to display all items on download image?
- series name and data for highcharts assigned via loop
- How to put date into drilldown chart title based on drilled point x value (datetime)..?
- HighChart overlap columns but with two groups
- Highcharts: Dynamic drilldown (stacked chart) in Combo Dual Axes
- How to set the graph line chart dynamically?
- Drupal Visualization without Aggregation in Views
- Unable to set a format for values on a heatmap