2013-05-02 37 views
0

我的代碼如下:Legend在Highcharts不應該拿起序列數據中指定的顏色

var options = { 
    chart: { 
    type: 'column', 
    events: { 
     click: $scope.goToPath(link) 
    } 
    }, 
    title: { 
    text: "" 
    }, 
    xAxis: { 
    categories: ['You', 'Average', 'Top Quartile'], 
    labels: { 
     style: { 
     fontSize: '14px', 
     color: 'grey' 
     } 
    } 
    }, 
    yAxis: { 
    title: { 
     text: '' 
    } 
    }, 
    plotOptions: { 
    column: { 
     colorByPoint: true, 
     dataLabels: { 
     enabled: true, 
     color: '#000000', 
     style: { 
      fontWeight: 'bold' 
     }, 
     formatter: $scope.getBarValues() 
     } 
    } 
    }, 

    series: [{ 
     showInLegend: true, 
     name: 'Planning Sites', 
     data: metric1["chart_numbers"], 
     colors: ['#3399CC', '#CCCC33', '#686868'] 
    }, { 
     showInLegend: true, 
     name: 'Build Out And Implementation', 
     data: metric2["chart_numbers"], 
     colors: ['#99CBE5', '#E4E599', '#BFBFBF'] 
    } 
    ] 
} 

在這裏,我想自定義顯示的圖例,以便它不使用的顏色數組中指定的顏色的每個串聯元件。我怎樣才能做到這一點?

我想要的傳說如下:

Black color - Planning 
Grey color - Build Out 

這裏是的jsfiddle:http://jsfiddle.net/Kc55H/

+0

能爲您提供的jsfiddle你例? – Nina 2013-05-02 11:25:41

回答

相關問題