score:0
A hackish way to do it would be to inject a rect into the svg.
document.getElementsByClassName("highcharts-root")[0].innerHTML += '<rect width="100%" x="0" y="40" height="150" fill="#ff0000"></rect>';
document.getElementsByClassName("highcharts-root")[0].innerHTML += '<rect width="100%" x="0" y="200" height="150" fill="#ff0000"></rect>';
score:2
For what I see you'll need to do styling by css Docs page, there is a live example here
@import 'https://code.highcharts.com/css/highcharts.css';
.highcharts-plot-background {
fill: #efffff;
}
.highcharts-plot-border {
stroke-width: 2px;
stroke: #7cb5ec;
}
Edit: I found a workaorund on this topic, you can change the background color for a specific range pane using plotBands:
e.g. yAxis : {[ ... plotBands : {color : '#f7d724', from : -50, to : 50}, ... ]}
In your case you should set the values for the first and last ones.
score:3
You can use the chart.plotBackgroundColor property to achieve your requirements.
Demo: https://codesandbox.io/s/vue-template-pt9jp
And because your chart is rendered dynamically, I encourage to disable animation:
chart: {
type: "spline",
title: "Hassaan",
animation: false
},
API: https://api.highcharts.com/highcharts/chart.plotBackgroundColor
Source: stackoverflow.com
Related Query
- Background color for multiple Highchart panes, in Vue app
- change background color for highchart candlestick plot
- Highchart Color Issue for series with single data with multiple colors
- Need to apply background color to each legend text highchart
- Highcharts, how to change hover bg color for series with multiple columns (categories)
- Set background color to HighChart xAxis labels
- HighChart : plot line click event for multiple chart
- Highcharts - In area chart how to use gradient color for multiple series?
- Set background color for only one pane in multi-pane Highstock chart
- Pan one of multiple Y axis for highchart
- Highchart heatmap: exclude the total row for color Axis
- Cannot set Individual Point color in Series for Highstock API, it works for Highchart API
- how to add an color picker control to highchart for changing the color of series by user
- Highcharts for multiple plot lines each with a different color and show tooltip?
- Highchart Treemap colorindex for fixed color values
- How to change the Highchart plotline color for theme
- How can I apply different background color to entire tooltip for different series in highcharts
- Automating htmlwidget: highchart graph generation for multiple time series
- Set Color for Pie Chart using HighChart + JSON data
- Is is possible to change line color in highchart xy plot for specific y range only?
- Column based Highchart drilldown series assign color code to each column
- Issue in multiple exporting for HighChart with scrollbar
- How to add background color on highchart based on flag?
- How to adjust the height and width of background color in Highchart
- How to create dynamic color for highchart with dynamic dates?
- set the background color for column group graphs in highcharts
- How to set color for non plotting Area in HighChart
- How to create multiple highchart and print in HTML page by using for loop?
- Differtent pattern color for every single column in highchart
- how to avail bg color for every bar in highchart
More Query from same tag
- VueJs highstock cant draw graph properly
- Highcharts: areasplinerange with fill color that takes account of direction of range
- Highcharts - Fix the Width of the xAxis Categories (and Wrap them)
- Highcharts 3.0 beta threshold documentation?
- Highcharts xAxis datetime from start
- Highchart Treemap with Multiple series and should behave live heat map
- Highstock multiple series irregular time
- Highchart angular overflows container
- TypeError: Highcharts[h] is not a function
- Fixed padding between the bars in Highcharts
- Highchart 5: Pie Drilldown labels and back button not visible
- For highstocks data grouping can you set data group points to null if there is less than a certain number of samples within it?
- Highchart group by month from corresponding column data
- What is the best way to integrate Highcharts with Curljs?
- Using a fill pattern instead of colour with HighCharts
- how to develop custom chart with box annotations as like attached image
- yii highcharts how to set date format in x-axis
- How to set tooltip background as point color for split chart in Highcharts?
- How to hide specific dots and labels onmouseover in highcharts
- Highcharts and EXTJS 3: Labels in x axis overlap
- Highcharts yaxis labels Format
- Shaping json object
- How to set the default display block position on the time line of highstock charts?
- Using Highcharts to show multiple stacked bar charts next to each other
- AngularJS for Highcharts with dynamic ajax data
- Column chart: Set background of exactly one column
- How to add text labels to a numerical x axis in Highcharts
- Redrawing Highcharts after service call - Angularjs
- Highcharts Bar Chart: possible to combine datapoints inside dataLabels?
- Highstocks chart doesn't show up properly