set different colors for each column in highcharts

后端 未结 4 1527
无人共我
无人共我 2020-11-29 05:53

I need to set different colors for each column in Highcharts graph dynamically. My Highcharts graph is:

options = {
           


        
4条回答
  •  盖世英雄少女心
    2020-11-29 06:05

    Here is another solution with the latest version of Highcharts (currently 3.0).

    Set the colorByPoint option to true and define the color sequence that you want.

    options = {
        chart: {...},
        plotOptions: {
            column: {
                colorByPoint: true
            }
        },
        colors: [
            '#ff0000',
            '#00ff00',
            '#0000ff'
        ]
    }
    

    Here is an example based upon Highcharts Column with rotated labels demo

提交回复
热议问题