Custom chart legend symbol - Javascript highcharts

Javascript examples for highcharts:Chart Legend

Description

Custom chart legend symbol

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</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> 
      <style id="compiled-css" type="text/css">

#container {//from   ww w  .j  ava2  s .  c o  m
   min-width: 310px;
   max-width: 800px;
   margin: 0 auto;
}


      </style> 
      <script type="text/javascript">
$(function() {
    $('#container').highcharts({
      series: [{
        data: [],
        id: 'main',
        marker: {
          symbol: 'url(https://www.highcharts.com/samples/graphics/sun.png)'
        }
      }, {
        linkedTo: 'main',
        data: [1, 3, -2, -4]
      }]
    });
});

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

Related Tutorials