sebastien leblanc
sebastien leblanc

Reputation: 675

Google charts not showing axis labels

This is not for the image charts.
I have the following code that generates the right chart but the labels don't show. The chart div is in an other div that is used as a tab on my page.
When I run the function when the tab containing the chart is not selected, the chart appears with no labels. When I run the function with the tab selected, the labels appear.

  drawChart()
  }

   function drawChart() {
    var data = new google.visualization.DataTable();
    data.addColumn('string', 'Weeks');
    data.addColumn('number', 'Indice');

    data.addRows(arrIndice1);

    var options = {
      width:"900",
      height:"500",
      legend: "none",
      title: 'Indice 1',
      chartArea:{left:20,top:50,width:"85%",height:"75%"} 
    };

    var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
    chart.draw(data, options);
  }

Upvotes: 3

Views: 6703

Answers (1)

yunusual
yunusual

Reputation: 325

chartArea options seem to cover the axis labels when they increase the chart size. Try removing the chartArea:{left:20,top:50,width:"85%",height:"75%"} part.

Upvotes: 2

Related Questions