min, max threshold in highcharts
A better way to approach this problem is to add two plot lines on the chart indicating the minimum and maximum values allowed.
Let's say you would like to apply this to the yAxis and set a minimum of 100 and a maximum of 500, you can like so:
var min = 100;
var max = 500;
yAxis: {
min: min - 100,
max: max + 100,
plotLines: [{
id: 'limit-min',
color: '#FF0000',
dashStyle: 'ShortDash',
width: 2,
value: min,
zIndex: 0
}, {
id: 'limit-max',
color: '#FF0000',
dashStyle: 'ShortDash',
width: 2,
value: max,
zIndex: 0
}]
}
The reason for adding and subtracting 100 to the max and min values is because we'd like the plot lines to be visible on the chart.
Hope that helps.
cypronmaya
Updated on June 08, 2022Comments
-
cypronmaya 9 months
@Hightcharts stock How can i have two threshold's ? for min,max in this graph http://jsfiddle.net/CYJAk/16/
As an example in here there's only one threshold set http://jsfiddle.net/gh/get/jquery/1.6/highslide-software/highcharts.com/tree/master/samples/stock/demo/area/
or
instead of threshold option in highcharts, is there way i can show red spots/points when they fall out of min:max range?
-
Jon Egerton about 10 yearsYou need to document your work here - link based answers are not usually acceptable.
-
KatieK about 10 yearsYour link-only answers lead directly to your website. This is not a valuable contribution to the community.