问题
Is there any way to update the color of a single point in a grouped data set? I can't seem to find a way to reliably set the colors.
A fiddle can be found here demonstrating the issue.
回答1:
Points are grouped during the rendering process of the chart so they cannot be specifically targeted via constructor options (because we don't know which points will be generated by Highcharts algorithms).
What is more, Higcharts doesn't allow performing update
function on the grouped point.
As a workaround your can change the CSS of point's SVG element:
chart.series[0].groupedData[0].graphic.css({
color: 'red'
});
Live demo: http://jsfiddle.net/BlackLabel/9ey2yq3u/
API reference: https://api.highcharts.com/class-reference/Highcharts.SVGElement#css
来源:https://stackoverflow.com/questions/48725419/highcharts-update-grouped-data-point-color