0

我的代码如下:

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/

4

1 回答 1

0

对于您还可以设置的每个系列color,请参阅:http: //jsfiddle.net/Kc55H/1/

于 2013-05-02T12:16:32.607 回答