Highcharts列不显示不同的颜色

时间:2015-11-27 11:12:28

标签: javascript highcharts

我正在使用Highcharts并显示列,但所有列颜色都是#7cb5ec。我尝试添加一种"颜色:"数组甚至没有选项,默认颜色不显示。我的代码有什么问题?

Demo on jsfiddle

var colors =['yellow','#058DC7', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'];

var chart = new Highcharts.Chart({
    chart: {
        renderTo: 'container',
        type: 'column',
        colors: colors
    },
    title: {
        text: 'Registreringer fra babkart.no',
        style: {'fontSize': '12px'}
    },
    xAxis: {
        categories: ["Oslo","Arendal","B\u00e6rum","Asker","Larvik","V\u00e5g\u00e5","Skien","Porsgrunn","Tinn","Gran"]
    },
    yAxis: {
        title: {
            text: 'poster'
        }
    },
    series: [{
        showInLegend: false,
        name: 'Antall registrerte poster',
        data: [1,13417,11745,10777,7919,6540,5873,4696,4122,4073]
    }]
});

1 个答案:

答案 0 :(得分:0)

尝试给出这样的颜色,请检查[this] [1]

  [1]: http://jsfiddle.net/DwW3m/459/