Show special marker on column chart - Javascript highcharts

Javascript examples for highcharts:Column Chart

Description

Show special marker on column chart

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Columns with icons</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
      <script type="text/javascript">
$(function () {//from  w w w  .  j  a v  a  2  s .c  om
    $('#container').highcharts({
        chart: {
            type: 'column'
        },
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },
        plotOptions: {
            column: {
                dataLabels: {
                    enabled: true,
                    useHTML: true,
                    formatter: function() {
                        return '<div style="text-align:center"><div>' + this.y + '</div><div><img src="http://placehold.it/' + (this.y == 0 ? '5' : this.y*2) + '/' + (this.y == 0 ? '5' : this.y*2) + '"></div></div>';
                    },
                    y: 0
                }
            },
            series: {
            }
        },
        series: [{
            data: [3, 4, 6, 0, 0, 2, 4, 0, 1, 6, 3, 2]
        }]
    });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <div id="container" style="height: 400px"></div>  
   </body>
</html>

Related Tutorials