score:2
Accepted answer
it can be done using api after chart is rendered:
var chart = $('#container').highcharts();
var extremes = chart.yaxis[0].getextremes();
var maxy = extremes.max;
var miny = extremes.min;
chart.yaxis[0].addplotband({
color: 'green',
from: 150,
to: maxy
});
chart.yaxis[0].addplotband({
color: 'red',
from: miny,
to: '150'
});
function getextremes()
returns current extremes for the axis (datamax, datamin, max and min axis value). and those values are used to set proper bands. note: additional check should be done if hardcoded value (150) is between miny and maxy.
see updated example at jsfiddle.
Source: stackoverflow.com
Related Query
- Change plotBands options after chart creation
- Highcharts-Vue chart options does not change values after it is set
- Change Highcharts tooltip formatter from chart Object , after chart is rendered
- Change xAxis and yAxis title of drilldown chart after entering into second series
- Highcharts: redraw chart after changing options
- Need to precisely set Highcharts axis min/max after chart creation
- How to change tooltip valueSuffix after chart is rendered?
- Change HighCharts pointInterval after creating chart
- How to change the series color and mark after I draw the line chart in highcharts?Does it has databound event?
- How can I change highcharts events after the chart has been initialized
- Get notice when a Highcharts chart is change after change the window size
- highchart drill down break bar chart after change title
- Why aren’t those 2 HighCharts codes equivalent? (Or is there a way to modify a call to legendItemClick after the creation of the chart object?)
- Highstock change xAxis minRange after chart is loaded
- HighCharts Export Breaks After Resetting Chart Options
- Change plotBand label after creation [highcharts]
- Highcharts remove labels after chart creation / drilldown
- chart not updating after changing the chart options
- Highcharts (9.0.1): drilldown problem after change chart type dynamically
- Can't change series edgeColor in highCharts after chart is drawn
- Programmatically change a chart title in highcharts
- Highcharts : Change opacity of a column chart
- Highcharts / jQuery - destroy and rebuild chart with original options
- How do you increase the performance of highcharts chart creation and rendering
- Highcharts how to change x axis options
- highcharts jquery dynamic change chart type column to bar
- HighCharts Dynamically Change Chart Type
- Highchart - Redraw Chart after Window is resized
- Change series data dynamically in react-highcharts without re-render of the chart
- change theme of highscharts (highstock) chart
More Query from same tag
- Specify color for each point in scatter3d
- HighStock Navigator Handles are not moving
- Highchart x-Axis labels shows double dates
- Highcharts: Value will not be updated
- Why drilldown x-axis points not matching with corresponding bars?
- How do I make npm pack "highcharts-export-server" wait for it to finish processing
- How can I create Highcharts Arearange graph from CSV file?
- Responsive highchart gauge
- Highcharts get table from range selected only
- Why .html() doesn't work with SVG selectors using jquery ?
- Pointplacement for a column when two columns are shown in same chart
- Highcharts - get bottom position for each stacked category
- R HIGHCHARTER - How to display additional series values on a highchart hover?
- Additional data in pointFormat of tooltip in highcarts
- AngularJS Directive Applying Wrong Data
- Highmaps mappie zooming issue
- Overlap bars in highchart's columnrange plot
- Highchart java script getting filled
- Highcharts-Vue wait for data then update series
- highcharts configuration
- Prevent Nil Values in Transformed Array
- how to use Highcharts on Ionic?
- How to add Modal pop up on nodes of org chart Highcharts
- How to display grid line on top of highchart
- dataLabels are not showed in boost mode for line chart
- X-axis interval in Highcharts
- Exclude a specific series from exporting to csv
- How to add mean in a boxplot made with highcharter?
- Not able to align highchart made using angular js
- Highstock set different colors for different markers