有没有一种方法可以在高图中为类型为“面积”的图表设置背景颜色和不透明度?
根据文档,您必须通过将颜色指定为rgb值并添加不透明度值来设置不透明度。然而,当我这样做时,图表的填充颜色变成了黑色。以下是我的代码:
<script type="text/javascript">
$(function() {
var javascriptArray = <?php echo json_encode($array);?>;
var newjavascriptArray = <?php echo json_encode($uniqueDates);?>;
var valueArray = <?php echo json_encode($total); ?>;
var js_array2 = [5, 10, 15];
$('#container').highcharts({
credits : {
enabled: false
},
exporting:
{
enabled: false
},
chart: {
backgroundColor: '#10416A',
type: "area"
},
title: {
style : {
color: "white"
},
text: "Progress"
},
subtitle: {
style : {
color: "white"
},
text: 'Village Print & Media'
},
xAxis: {
// gridLineWidth: 0,
// lineWidth: 0,
// minorGridLineWidth: 0,
title:{
style: {
color : "white"
},
margin: 50,
text: "February"
},
labels: {
style : {
color: "white"
},
},
categories: newjavascriptArray
},
yAxis: {
allowDecimals: false,
title: {
style: {
color : "white"
},
text: "Points"
},
labels : {
style: {
color: "white"
},
},
},
plotOptions: {
series: {
color: "#00A6CE",
lineColor: "#00A6CE",
fillColor: 'rgb(0, 166, 206, 0.4)',
// fillOpacity: 0.8,
marker : {
fillColor: "#00A6CE"
},
},
line: {
dataLabels: {
enabled: false
},
enableMouseTracking: true
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 2,
color: "white"
},
series: [{
name: 'Points Ray',
color: "white",
dataLabels: {
color:"white"
},
data: valueArray
}]
});
});