0
votes

In my application I'm using highcharts and I want to apply different colors for different value. My y axis min value is 0 and max value is 10. So based on this I want to show ten different colors unique for a number. So I tried like,

column: {
        zones: [{
            value: 10,
            color: 'blue'
          }, {
            value: 9,
            color: 'red'
          }, {
            value: 8,
            color: 'grey'
          }, {
            color: 'yellow'
          }
        ]
      }

In plot options but it applies only blue and yellow. Yellow is for 10 and for others it is blue. How can I change bar colors based on the value? Thank you.

1
In HighCharts, which bar chart you are using? - Chirag

1 Answers

1
votes

Just use the zones in the right order like this

column: {
  zones: [{
    value: 8,
    color: 'grey'
  }, {
    value: 9,
    color: 'red'
  }, {
    value: 10,
    color: 'blue'
  }, {
    color: 'yellow'
  }]
}

Fiddle