I am developing a series chart of efficiencies (in percentage) over time.
I have specific requirements for the legend:
All of this is working in a fiddle - https://jsfiddle.net/slaws/0wjpcaqt/138/ - which uses styledMode and a custom legend and dynamically sets the opacity of the chart and custom legend elements:
$('.highcharts-legend-item.highcharts-series-' + value).css('opacity', new_opacity);
$('.highcharts-series.highcharts-series-' + value).css('opacity', new_opacity);
$('.highcharts-markers.highcharts-series-' + value).css('opacity', new_opacity);
However I am struggling with one more key requirement, which is to export the current state of the chart to an image or PDF, with all of series exported with their current 'active' or 'inactive' state. So, if a series is faded, it should be exported as faded to the image or PDF.
Here are screenshots to illustrate:
Any suggestions how I export the chart with it’s styling currently in effect?
PS The legend in the fiddle may start off misaligned, but rerunning it corrects that.
You should not use the CSS to achieve it, but do a series update to keep those changes in the chart config.
events: {
checkboxClick() {
this.update({
opacity: 0.5
})
}
},
Take a look at this approach: https://jsfiddle.net/BlackLabel/b4n0z5k8/
API: https://api.highcharts.com/class-reference/Highcharts.Series#update