score:1
Accepted answer
You can use programmatically generated plot-bands. For example:
const plotBands = [];
const series = warData.map((m, index) => {
if (m.flag === 1) {
plotBands.push({
color: 'yellow',
from: index - 0.5,
to: index + 0.5
});
}
return {
name: m.Month,
data: [
[m.Month.toString(), JSON.parse(m.Maintenance)]
],
};
});
const options = {
xAxis: {
type: "category",
plotBands
},
...
};
Live demo: http://jsfiddle.net/BlackLabel/95gcsheo/
API Reference: https://api.highcharts.com/highcharts/xAxis.plotBands
Source: stackoverflow.com
Related Articles
- Column based Highchart drilldown series assign color code to each column
- How to add background color on highchart based on flag?
- Highchart columnrange, color code lines based on data
- Background color for multiple Highchart panes, in Vue app
- Need to apply background color to each legend text highchart
- Highcharts Change Bar Background Color Based on categories value
- Set background color to HighChart xAxis labels
- how to change color of line chart in highchart based on a categorical column in r?
- Set series color based on X axis on a column Highchart
- highchart - label color by based on point data
- change background color for highchart candlestick plot
- How to change rCharts Highchart Color based on Factor Variable
- How to adjust the height and width of background color in Highchart
- Color selection based on a function for Highchart graphs?
- Highchart background based on percentage
- Changing background color for countries based on data
- How to add color in highmap highchart based on value
- Yii Highchart extension - Change color based on value
- Highchart - change color of one x-axis label only
- Highcharts Change Bar Color Based on Value
- Highcharts dynamically change bar color based on value
- Change color of bars depending on value in Highchart bar-chart with MVC3
- How to apply custom color on candlesticks based on OPEN/CLOSE values?
- Highcharts - change background color along specific date range
- Can color of data label be different inside and outside of the bar in Highchart
- change legend color high charts based on data
- Changing color of spline lines based on values in HighCharts
- Is it possible to change background color of highcharts?
- How to change series legend text color in HighChart chart?
- Highcharts.js - Background color of axis only
- Add tooltip in highchart custom button
- Highcharts: how to get the data points in the zoomed window?
- HighStock Chart don't display line for missing Y axis data
- Convert the y-axis values to Millions in dual axis high charts
- in high charts unable to set y axis to 100
- Unable to apply custom pipe to high chart tooltip values
- install highcharts exporting server
- How to implement similar line chart using the Highcharts library?
- Can color of data label be different inside and outside of the bar in Highchart, even if it has negative numbers?
- Highstock flag hover state: update font color
- Overwrite Highcharts X Axis
- How to use High Charts with AJAX + SpringMVC
- How to load highcharts annotations module in angular module app.module.ts?
- Highcharts pass external variable to global options
- How to change scrollbar position when switching chart type in highcharts
- highcharts add plotline label with images
- Highcharts: Change Highlight Color of Column Chart
- HighCharts (Stock) Styling Issues (Mobile and Date Selector)
- How to show current value on two x-axis using Highcharts?
- Highchart selection without zoom