Hi there,

I have a chart that used to work well for quite some time. I am not sure 
when the issue first appeared. When using the "ticks: 
data.getDistinctValues(0)" option to define the hAxis, a very big gap is 
now generated in the chart:



If I remove the tick definition, it seems to get back to normal:



If I force the ticks to an array of dates (same as the data), it also has 
the issue. Here is the chart code that fails. Any idea if something has 
changed?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
  <head>
    <script type='text/javascript' src='https://www.google.com/jsapi'
></script>
    <script type='text/javascript'>
        google.load("visualization", "1", {packages:["corechart"], 
'language': 'en'});
    </script>
  </head>
  <body>                
    <script type='text/javascript'>

    google.setOnLoadCallback(monthlyline_B);
    function monthlyline_B() 
    {
        var data = new google.visualization.DataTable();

        data.addColumn('date', 'Day of the month');
        data.addColumn('number', 'A Values');
        data.addRows([
        [new Date(2016, 4, 15),124],
        [new Date(2016, 4, 16),177],
        [new Date(2016, 4, 17),228],
        [new Date(2016, 4, 18),305],
        [new Date(2016, 4, 19),555],
        [new Date(2016, 4, 20),639],
        [new Date(2016, 4, 21),761],
        [new Date(2016, 4, 22),893],
        [new Date(2016, 4, 23),923],
        [new Date(2016, 4, 24),972],
        [new Date(2016, 4, 25),997],
        [new Date(2016, 4, 26),103],
        [new Date(2016, 4, 27),105],
        [new Date(2016, 4, 28),108],
        [new Date(2016, 4, 29),126],
        [new Date(2016, 4, 30),131],
        [new Date(2016, 4, 31),0],
        [new Date(2016, 5, 1),0],
        [new Date(2016, 5, 2),0],
        [new Date(2016, 5, 3),0],
        [new Date(2016, 5, 4),0],
        [new Date(2016, 5, 5),0],
        [new Date(2016, 5, 6),0],
        [new Date(2016, 5, 7),0],
        [new Date(2016, 5, 8),0],
        [new Date(2016, 5, 9),0],
        [new Date(2016, 5, 10),0],
        [new Date(2016, 5, 11),0],
        [new Date(2016, 5, 12),0],
        [new Date(2016, 5, 13),0],
        [new Date(2016, 5, 14),0]]);
                    
        var options = {
          fontSize: 11,
          hAxis: {ticks: data.getDistinctValues(0), format: "d", 
minTextSpacing:1,  showTextEvery:1, textPosition: 'out',  titleTextStyle: {
italic: false, color: 'Black'}, title: "Day of the month", gridlines:{count
:-1}},
          series: [{pointSize: 4}]
        };
        var chart = new google.visualization.AreaChart(document.
getElementById('monthlyline_B'));
        chart.draw(data, options);
    
    }
    </script>

    <div id='monthlyline_B' style='width: 100%; height: 250px;'> </div>     
               
                    
  </body>
</html>



-- 
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 [email protected].
To post to this group, send email to [email protected].
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/b7b65c9e-4de1-4b4c-bd48-3a92a10ed31e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to