Highcharts update grouped data point color

孤人 提交于 2019-12-11 16:20:02

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!