2016-03-23 163 views
0

有沒有方法可以在高圖中爲類型爲area的圖表設置背景顏色和不透明度?Highcharts設置背景顏色和不透明度

根據文檔,您必須通過將顏色指定爲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 
    }] 
}); 
}); 

回答

相關問題