2016-06-14 60 views

回答

0

enter image description here

你需要的是與黑暗的主題選項Highcharts的areaspline財產。

這裏是一個例子;

$(function() { 
$.getJSON('https://www.highcharts.com/samples/data/jsonp.php?filename=usdeur.json&callback=?', function (data) { 

    $('#container').highcharts({ 
     chart: { 
      zoomType: 'x' 
     }, 
     title: { 
      text: 'USD to EUR exchange rate over time' 
     }, 
     subtitle: { 
      text: document.ontouchstart === undefined ? 
        'Click and drag in the plot area to zoom in' : 'Pinch the chart to zoom in' 
     }, 
     xAxis: { 
      type: 'datetime' 
     }, 
     yAxis: { 
      title: { 
       text: 'Exchange rate' 
      } 
     }, 
     legend: { 
      enabled: false 
     }, 
     plotOptions: { 
      area: { 
       fillColor: { 
        linearGradient: { 
         x1: 0, 
         y1: 0, 
         x2: 0, 
         y2: 1 
        }, 
        stops: [ 
         [0, Highcharts.getOptions().colors[0]], 
         [1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')] 
        ] 
       }, 
       marker: { 
        radius: 2 
       }, 
       lineWidth: 1, 
       states: { 
        hover: { 
         lineWidth: 1 
        } 
       }, 
       threshold: null 
      } 
     }, 

     series: [{ 
      type: 'area', 
      name: 'USD to EUR', 
      data: data 
     }] 
    }); 
}); 

this jsFiddle是以上示例的實況形式。

這裏重要的是:

<script src="https://cdnjs.cloudflare.com/ajax/libs/highcharts/4.2.5/themes/dark-unica.js"></script> 

line;這給圖表黑暗主題

1

遵循下面的代碼:

低於設定在你的JavaScript代碼,並更改您要喜歡的顏色...

fillColor : { 
    linearGradient : {x1: 0, y1: 0, x2: 0, y2: 1}, 
    stops : [ [0, '#2a2a2b'], [1, '#3e3e40']], 
} 

下面的顏色是分配到線

[0 ,'#2a2a2b']

while

[1,「#3e3e40」]

上面一個是陰影區域

我敢肯定,這將幫助你......你只需要添加此代碼,並改變你你喜歡的顏色代碼...

謝謝...