change "defaultOptions" lang in line Charts - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

change "defaultOptions" lang in line Charts

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">
    $(window).load(function(){// w ww  . j  a  v a  2 s  . co m
var methodtowrite = {
    'highcharts.months.array': function () { return ['Janvier', 'F?vrier', 'Mars', 'Avril', 'Mai', 'Juin',
         'Juillet', 'Ao?t', 'Septembre', 'Octobre', 'Novembre', 'D?cembre']; },
    'highcharts.months.loading': function() { return 'loading';}
};
$(function () {
   Highcharts.setOptions({
      lang: {
    loading: methodtowrite['highcharts.months.loading'](),
    months: methodtowrite['highcharts.months.array']()
      }
   });
    $('#container').highcharts({
        chart: {
        },
        xAxis: {
            type: 'datetime',
            dateTimeLabelFormats: {
                month: '%B'
            }
        },
        yAxis: {
        },
        series: [{
            data: [0.029, 71.5, 1.06, 92, 140, 1.760, 135, 80, 0.0216, 0.194, 9.56, 54.4]  ,
            pointStart: Date.UTC(2010, 0, 1),
            pointInterval: 30 * 24 * 3600 * 1000 // 30 days
        }]
    });
});
    });

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

Related Tutorials