使用highchart时,我需要更改堆栈图中列的不透明度。因为我需要透明
<script type="text/javascript">
$(function () {
$('#trend').highcharts({
chart: {
type: 'column'
},
title: {
text: 'Weight Oscillation Projection'
},
xAxis: {
categories: ['1st Week', '2nd Week', '3rd Week', '4th Week', '5th Week', '6th Week']
},
yAxis: {
title: {
text: 'Weight (Kg)'
},
stackLabels: {
enabled: false,
}
},
legend: {
enabled: false,
},
tooltip: {
enabled: false,
},
plotOptions: {
column: {
stacking: 'normal',
dataLabels: {
enabled: false,
}
},
},
series: [{
name: 'Jane',
data: [2, 2, 3, 2, 1],
}, {
name: 'Joe',
data: [3, 4, 4, 2, 5],
color: '#fff',
style: {opacity: 0.0}
}]
});
});
</script>
我知道系列->数据对象没有更改样式的属性。我们该怎么做?
使用rgba格式更改不透明度。
例:
color: 'rgba(255, 255, 255, 0.50)'
参考
Highcharts中的半透明颜色以rgba格式rgba(255,255,255,1)给出。最后一个参数是Alpha或不透明度,范围从0(完全透明)到1(完全不透明)。因此,Highcharts API中没有单独的不透明度选项。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句