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
- How to pass JSP array to Javascript of highchart to generate a column chart
- Chart with Multiple CandleStick. HighStock/HighCharts
- Exporting 2 button option issue in highchart
- Highstock navigator handles options do not work
- Issue transferring Angular2 example from Plnkr to real application
- Highcharts displaying Date axis from milliseconds
- Change SVG stroke options in Highcharts
- Highchartjs change based on click
- Animating div on top of Highcharts very slow
- Highchart Marker image hides if large dataset is produced
- Use django variable (array of elements from sqlite3 database) inside javascript embedded code
- Highcharts: plot a number that was too small to detect?
- Remove Highchart series in shiny
- HighStocks - Adding 2 charts on same page
- Animate change in piechart start angle with highcharts-ng
- Highcharts: Add circle to scatter plot
- How to create dynamic update spline Highcharts chart?
- Overwrite Highcharts X Axis
- Highcharts How to Show Loading Animation At Set Data
- Time display at x axis instead of date display in highstock
- Javascript callbacks in Typescript. Accessing both class members and javascript 'this' parameter
- Invalid argument line 80 in highcharts.js
- Sweep animation with highcharts pie
- Highstock no rangeSelector appear with async loading
- Dynamically add an average line in highchart in angular
- How to auto save highcharts as image in specific folder
- Pass a List of Series to SetSeries
- Centered axes in highcharts
- Highcharts: how to show more info in tooltip?
- HighCharts Stock Chart error code 18