chart legend format - Javascript highcharts

Javascript examples for highcharts:Chart Legend

Description

chart legend format

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> 
      <script type="text/javascript">
$(function () {/*w w  w  .j a  v  a 2 s.  com*/
    var chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            backgroundColor: '#',
            type: 'line'
        },
        xAxis: {
            labels: {
         style: {
            color: '#ffffff',
         font: '9px Arial'
             }
      },
            categories: ['03:20', '03:25', '03:30', '03:35', '03:40', '03:45', '03:50', '03:55', '04:00', '04:05']
        },
        yAxis: {
            labels: {
         style: {
            color: '#ffffff',
             }
      },
        },
        title:{
    text:''
},
        legend: {
            layout: 'vertical',
            backgroundColor: '#FFFFFF',
            floating: true,
            align: 'left',
            x: -1000,
            verticalAlign: 'top',
            y: 70
        },
        tooltip: {
            formatter: function() {
                return '<b>'+ this.series.name +'</b><br/>'+
                    this.x +': '+ this.y;
            }
        },
        plotOptions: {
        },
        series: [{
            color: '#ffffff',
         name: 'Time - Price',
            data: [274.69, 274.89, 275.24, 275.71, 275.82, 276.00, 276.96, 276.39, 276.18, 276.24]
        }]
    });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://code.highcharts.com/modules/exporting.js"></script> 
      <div id="container" style="min-width: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div>  
   </body>
</html>

Related Tutorials