0
votes

Please see below code for chart. It is not displaying colors properly as defined in the js. When I run this js in jsfiddle, it does show me correct colors.

    jQuery(document).ready(function () {  


        var my_chart = {
            chart: {
                renderTo: 'divTotalOpenPositionsGraph',
                type: 'column',
                marginLeft: 13, marginBottom: 30,marginTop:5,
                fontFamily: 'Arial,Helvetica,sans-serif',

            },
           credits: {
                enabled: false
            },
            title: {
                      text: 'Open Position'
                }
            },
            legend: {
                enabled: false                

            },

            plotOptions: {
                series: {
                 colorByPoint: true,
                  borderWidth: 0,
                  animation: {
                        duration: 5000
                    },
                 dataLabels:{
                

     enabled:true,
                    formatter:function(){
                        if(this.y > 0)
                            return this.y;
                        }
                }
            }
        },
        series: [{
                name: 'Positions',
                data: [6,9]
            }],
            colors: [
                '#f89422',
               '#8cc641'
                   ],
         xAxis: {
           categories: ['Internship','Employment'], 
            labels: {
                enabled: true
            }
        },
        yAxis: {
        title: {
            text: null
        },
        labels: {
            enabled: false
        }
    },
    };
    new Highcharts.Chart(my_chart);
}); 

Can anyone please correct me on this? I need orange color in first column and green in second column.

Thank you in advanced.

1
Maybe you have some old version of Highcharts? Since in jsFiddle it works..Paweł Fus

1 Answers

0
votes

I came across some syntax errors, but as a result I reproduced your example here:

http://jsfiddle.net/WVgDM/

Colors are as you described.