javascript - Set color of Highcharts series bar based on value -
i have this plunker playing highcharts. wondering if possible set color of bar based on value of bar. right have 5 bars changing on interval between 0 , 100, , want colors of bars reflect number range in.
0 < x < 25
neutral color
25 < x < 50
yellow
50 < x < 75
orange
75 < x < 100
red
i familiar series methods in api, dont see changing color series. have done using chart js trying hand @ highcharts since used more.
i put in plunker link after randomize datasets, @ bottom of interval, , changed line color
$scope.chart.series[0].update( {color: "red"} );
honestly, why not write function fires @ start of interval generates numbers , associated color based on number, , set numbers , colors accordingly. use array of objects or something.
i leave function exercise solve.
Comments
Post a Comment