如何添加背景颜色到highcharts堆叠条形图列像在图片中
我试着在highcharts中找到官方documentation,但不幸的是找不到。
hi3rlvi21#
没有直接从API为堆积条形图创建这样的阴影背景的方法,但是您可以将其创建为禁用enableMouseTracking和showInLegend选项的虚拟系列。
enableMouseTracking
showInLegend
样本代码:
plotOptions: { bar: { stacking: 'percent' } }, series: [{ color: '#ddd', enableMouseTracking: false, showInLegend: false, data: [7, 7] }, { data: [1, 1] }, { data: [2, 2] } ]
演示:https://jsfiddle.net/BlackLabel/7vx2sn8d/API参考:https://api.highcharts.com/highcharts/series.bar.showInLegendhttps://api.highcharts.com/highcharts/series.bar.enableMouseTracking
1条答案
按热度按时间hi3rlvi21#
没有直接从API为堆积条形图创建这样的阴影背景的方法,但是您可以将其创建为禁用
enableMouseTracking
和showInLegend
选项的虚拟系列。样本代码:
演示:https://jsfiddle.net/BlackLabel/7vx2sn8d/
API参考:https://api.highcharts.com/highcharts/series.bar.showInLegendhttps://api.highcharts.com/highcharts/series.bar.enableMouseTracking