M
M
Mikhail Gavrilyuk2020-07-14 19:53:07
Google
Mikhail Gavrilyuk, 2020-07-14 19:53:07

How to make months in Russian in Google Charts?

How to make months in Russian in Google Charts?
5f0de33cce2eb423962269.jpeg

<html>
  <head>
   <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>	
  <script>
    google.charts.load('current', {packages: ['corechart', 'line']});
    google.charts.setOnLoadCallback(drawBackgroundColor);
    
    function drawBackgroundColor() {
        var data = new google.visualization.DataTable();
        data.addColumn('date', 'month');
        data.addColumn('number', 'обороты');

        data.addRows([
         [new Date(2018, 1, 1), 10000],
         [new Date(2018, 2, 1), 11000],
         [new Date(2018, 3, 1), 12000]
        ]);
        
      var options = {
        title: 'Обороты компании 2018-2020',
        hAxis: {
          title: 'Года',
          format: 'MMM YY'
      
        },
        vAxis: { title: 'Обороты' },
        backgroundColor: '#f1f8e9',
        legend: { position: 'top'},

        };

        var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
  
  </script>
  </head>
  <body>

    <div id="chart_div" style='width:fit-content'>
  </body>
</html>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
noker81, 2020-09-17
@noker81

google.charts.load('current', {packages: ['corechart', 'line'], 'language': 'ru'});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question