score:2

You can color parts of the graph if you point them in CSS. http://jsfiddle.net/0jsa3fw6/

JS:

    $(function () {
    $('#container').highcharts({
        title: {
            text: 'Monthly Average Temperature',
            x: -20 //center
        },
        subtitle: {
            text: 'Source: WorldClimate.com',
            x: -20
        },
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
                'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },
        yAxis: {
            title: {
                text: 'Temperature (°C)'
            },
            plotLines: [{
                value: 0,
                width: 1,
                color: '#808080'
            }]
        },
        tooltip: {
            valueSuffix: '°C',
            enabled: false
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0
        },
        series: [{
            name: "Cost Estimate Today",
            cls: 'costToday',
            data: [1, 2, 3],
            pointPadding: -0.05
        }, {
            name: "Cost Estimate Yesterday",
            cls: 'costYesterday',
            data: [10, 5, 8],
            pointPadding: -0.05,
            dashStyle: 'dash'
        }]
    });
});

CSS:

g.highcharts-series:nth-child(3) > path:first-child {
stroke: #e98300 !important;
}
g.highcharts-series:nth-child(1) > path:first-child {
stroke: #7ab800 !important;
}

Related Articles