score:2
You can prepare your own function which check is negative is or not, then set appropriate ticks. To achive this, you should use tickPositioner http://api.highcharts.com/highcharts#yAxis.tickPositioner
score:5
You can set the "floor", this defines the minimum possible value for min. When negative values are added, they will not be visible! (http://api.highcharts.com/highcharts/yAxis.floor)
yAxis: {
floor: 0
}
I know this question has been asked a long time ago and this property did not exist at the time. But I just encounter this problem and I think others will be happy to not having to search.
score:7
I achieved this by creating a function using setExtremes
var setMin = function () {
var chart = this,
ex = chart.yAxis[0].getExtremes();
// Sets the min value for the chart
var minVal = 0;
if (ex.dataMin < 0) {
minVal = ex.dataMin;
}
//set the min and return the values
chart.yAxis[0].setExtremes(minVal, null, true, false);
}
then in your chart, you call it like this:
$('#container').highcharts({
chart: {
events: {
load: setMin
}
},
});
score:8
You can add to your y-axis :
yAxis: {
title: {
text: 'Title of the y-axis'
},
min: 0 // this sets minimum values of y to 0
},
score:11
The option that you're looking for is called softMin
and was introduced in version 5.0.1. The docs describe it as follows:
A soft minimum for the axis. If the series data minimum is greater than this, the axis will stay at this minimum, but if the series data minimum is lower, the axis will flex to show all data.
yAxis: {
softMin: 0
}
Source: stackoverflow.com
Related Query
- Set highcharts y-axis min value to 0, unless there is negative data
- Can I set a minimum positive and a minimum negative axis value in Highcharts
- Highcharts Line - When Y axis min is set to 0, connecting line isn't shown for consecutive 0 values
- Highcharts x axis date full range even if there is not enough data
- Highcharts - set yAxis.max to max value from data
- Negative value for categories axis in highcharts
- Calculating a min y axis value in highcharts
- Highcharts align data label based on positive / negative value
- Highcharts js set last month x axis data
- My Highcharts graph with multiple axis ignores the max value I set for the first yaxis
- Highcharts align data label to x-axis if value is negative
- HighCharts y-Axis set min max with input field on rendered graph axis
- Highchart: Plot negative values on negative Y Axis ans set initial value
- Manually set y-axis min and max value and zoom-in behaviour in Highcharts
- How to set point in highcharts when x axis and y axis has data as text values?
- Highcharts chart axis exceeding set min and max values
- Any way to set min & max value for HighCharts Heatmap data?
- min and max axis value not respected in HighCharts chart with a logarithmic axis
- Want to set the y axis ticks to a fixed value Highcharts
- Incorrect data point value in highcharts navigator series when extending min and max date
- Set Additional Data to highcharts series
- How to set Highcharts chart maximum yAxis value
- Highcharts: Set y Axis Max and Min dynamically, and not at creation
- how to set the interval of points on Y - Axis highcharts
- How replicate the value of Y Axis on both sides of the axis in Highcharts
- Highcharts How to Show Loading Animation At Set Data
- Highcharts: min value of y axis on the bottom of chart
- Highcharts - set maximum range for yAxis but keep axis dynamic within that range
- how to set dynamic data in highcharts
- How to set a static minimum value for axes in Highcharts
More Query from same tag
- Showing different images in Highmaps when moving the mouse cursor to a point
- Highstock navigator step like the parent chart
- directive returns the same array a few times angularjs
- Highcharts JS - share legend color between pie charts
- Dynamic updates on a pair of charts when zoomed
- Remove border from multiple plots of Stacked and Grouped Column chart (Highcharts.js)
- Set 'src' attribute for document.createElement('script')?
- How to get current drilldown's id in Highcharts
- Highstock/Highcharts timestamp values
- highchart/highstock tooltip does not adjust after zoom
- Line and column combo chart with multiple columns for each category, how to position line marker for each category on a specific column?
- Adding Highcharts chart to draw2d canvas
- Highcharts stacked column highlight
- HIGHCHART: HOW TO START TICK AT (0,0)
- Highcharts yAxis click event
- Hide dataLabels at specific chart width in Highcharts
- Highchart dynamically draw Legend marker and trigger mouseover event
- Highcharts add a serie that does not exist
- How to create a legend for bar colors in a Highcharts bar chart
- Set Additional Data to highcharts series
- HighCharts: SVG outside plot area
- Highcharts query
- Number Formatting at Highcharts Chart Values?
- Highcharts with boost not rendering correctly at small intervals
- highcharts - disable fading series on marker hover
- How can i draw a high chart with two labels in x coordinate using highchart
- How do I skip a datapoint in Highcharts without causing an interruption in the line of the chart?
- Highcharts variable threshold
- Highcharts problems
- How do I pass in parameters to the Highcharts pointFormatter callback function