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: gradient 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).

see this jsfiddle example.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Enter key does not work in search box -