2016-06-14 37 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”]

上面一个是阴影区域

我敢肯定,这将帮助你......你只需要添加此代码,并改变你你喜欢的颜色代码...

谢谢...