Lee
Lee

Reputation: 77

change particular line chart series colour dynamically in highcharts

try to change the colour dynamically for particular part in line chart but can't get any idea , enter image description here

  series: [{
    data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6],
    zoneAxis: 'x',
    zones: [ {
            value:3,
        dashStyle: 'solid',
        color:'#7cb5ec',
        fillColor:'#7cb5ec'
    },{
        value: 8,      
        dashStyle: 'dot',
        color:'#FFA262'
    }, {
            value:11,
        dashStyle: 'solid',
        color:'#7cb5ec',
        fillColor:'#7cb5ec'
    }]
}]

here my fiddle

here i want to change the points(that have orange) colour in dynamic way in set of time interval i.e(5 sec)

please help me out to find the solution geeks

Upvotes: 0

Views: 1557

Answers (1)

morganfree
morganfree

Reputation: 12472

You need to dynamically update the series' zones. You can do it with Series#update().

chart.series[0].update({
  zones: [{ ... }]
})

If you want to do it periodically use setInterval().

live example: http://jsfiddle.net/8gwh9yL6/

Upvotes: 2

Related Questions