Chart being cut off

34 views
Skip to first unread message

Joaó Tiago Van Niekerk

unread,
Jan 30, 2018, 3:02:08 AM1/30/18
to Google Visualization API
Hi Guys,

I have this problem with my chart being cut off. My label is not showing and the numbering is cut off. 

Does anyone know what the problem can be?

Here is my code: 
google.charts.setOnLoadCallback(Combine_Column1);


function Combine_Column1() {

        var data = google.visualization.arrayToDataTable([
          ['Month', 'East', 'West'],
          <?php
  while( $row = sqlsrv_fetch_array($combine1)) {
      echo "['".$row["Month"]."', ".$row["East"].", ".$row["West"]."],";
}
  
  ?>
        ]);

        var options = {
          chart: {
            title: '',
  
          },
          bars: 'vertical',
  
          vAxis: {format: 'decimal', title: 'Level', viewWindow: {
        max:1630,
        min:1626
    }
}, 
  
          height: 500,
  legend : {position: 'top', maxLines: 2},
          colors: ['#00B1EA', '#003863', '#7570b3']
        };

        var chart = new google.charts.Bar(document.getElementById('column_combine1'));

         chart.draw(data, google.charts.Bar.convertOptions(options));
      }


<div id="column_combine1" style="padding: 20px;"></div>

P.s my data is coming from a MS SQL Database
2018-01-30_9-59-37.jpg

Daniel LaLiberte

unread,
Jan 30, 2018, 9:26:44 AM1/30/18
to Google Visualization API
The 'decimal' format appears to be the problem.  I don't know why.  Have tried formatting another way?

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/2faa7cfc-2dce-4e72-bb9a-e5be5e606c6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Sean Larson

unread,
Feb 2, 2018, 4:59:44 PM2/2/18
to Google Visualization API
Could it be because you are using the viewWindow to set the max/min instead of using the vAxis 'minValue' and 'maxValue' attributes? Also try setting your viewWindow style to 'pretty' 

vAxis: { viewWindowMode: 'pretty', baseline: 0, minValue: 0, maxValue: 100, minorGridlines: { count: 1 }, gridlines: { count: -1 } },

Something like the above. My guess is the viewWindow....

Joaó Tiago Van Niekerk

unread,
Feb 2, 2018, 5:30:11 PM2/2/18
to Google Visualization API
Thanks for your help. Will test on monday to see if that works.
Reply all
Reply to author
Forward
0 new messages