Set legend font sizes - Javascript highcharts

Javascript examples for highcharts:Chart Legend

Description

Set legend font sizes

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="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
      <script type="text/javascript">
$(function () {/*from ww  w  .  j a va 2  s. co m*/
$('#content').highcharts({
        chart: {
            type: 'column'
        },
        legend: {
              itemStyle: {
                 fontSize:'35px',
                 font: '35pt Trebuchet MS, Verdana, sans-serif',
                 color: '#A0A0A0'
              },
              itemHoverStyle: {
                 color: '#FFF'
              },
              itemHiddenStyle: {
                 color: '#444'
              }
        },
        title: {
            text: 'Title',
            style:{
                    color: 'white',
                    fontSize: '25px'
                }
        },
        subtitle: {
            text: 'Subtitle'
        },
         xAxis: {
            categories: [
                ' '
            ]
        },
        yAxis: {
            min: 0,
            title: {
                text: 'MMBTUs x 10,0000',
                style:{
                    color: 'white',
                    fontSize: '25px'
                }
            },
            labels: {
                style: {
                    color: 'white',
                    fontSize:'25px'
                }
            }
        },
        tooltip: {
            headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
            pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                '<td style="padding:0"><b>{point.y:.1f} mm</b></td></tr>',
            footerFormat: '</table>',
            shared: true,
            useHTML: true
        },
        plotOptions: {
            column: {
                pointPadding: 0.2,
                borderWidth: 0
            }
        },
        series: [{
            name: '2009',
            data: [4900000]
        }, {
            name: '2010',
            data: [4900000]
        }, {
            name: '2011',
            data: [5500000]
        }, {
            name: '2012',
            data: [5200000]
        }]
    });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <div id="content" style="min-width: 300px; height: 300px; margin: 2px; margin-bottom: 3px"></div>  
   </body>
</html>

Related Tutorials