Highcharts Demo

author(s): Torstein Hønsi

HTML

<script src="http://code.highcharts.com/highcharts.src.js"></script>

<div id="container" style="height: 400px"></div>

JavaScript

$(function () {
        
    function redrawColumns(chart){
        $(chart.series[0].data).each(function(i,e){
            if (e.y < 0 ){
                e.graphic.attr({fill:'red'});
            }
    
        });
    }
    
    var chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            type: 'column',
            events: {
                load: function(){
                    redrawColumns(this);
                },
                redraw: function(){
                    redrawColumns(this);
                }
            }
        },
        series: [{
            color: 'blue',
            data:[29.9, 71.5, 106.4, 129.2, 144.0, 176.0,- 135.6, 148.5, 216.4, -194.1, 95.6, 54.4]  
            //[[1,20],[2,5],[3,-10],[4,-20]]
        }]
    });
    });