javascript - Highcharts multi-color line -
i looking create highchart multi-colored line. if goes down under value, become red, , when comes on value, become green .
here picture example:
or maybe highcharts have other charts models differentiate high or low level color?
you can achieve coloring using lineargradient
coloring:
color: { lineargradient: { x1: 0, x2: 0, y1: 0, y2: 1 }, stops: [ [0, 'red'], [0.25, 'yellow'], [0.50, 'green'], [0.75, 'yellow'], [1, 'red'] ] }
here 0
in stops
relates minimum value of series , 1
maximum value, , in between percentages between values.
if find percentages according values prior creating chart use correct stops
values make relate specific values in data (at least approximately).
Comments
Post a Comment