How to force the Column Chart's Y-axis to start from zero

9,482 views
Skip to first unread message

Tong Sun

unread,
Aug 1, 2015, 11:27:18 AM8/1/15
to Google Visualization API
Hi, 

Google Chart will automatically raise the Y-axis' minimum value, so as to emphasis there differences. 

This is what I mean -- in https://jsfiddle.net/cL2q5p1z/1/, you can see that Y-axis' minimum value is 1.400,000. How to force it to zero, so as to emphasis on the comparative total size?

and found,

vAxis.baseline: vAxis property that specifies the baseline for the vertical axis.

so I tried to use "vAxis.baseline: 0," as shown in the jsfiddle, but that gave me an empty chart. 

Please help. 
Thanks


Daniel LaLiberte

unread,
Aug 1, 2015, 2:58:44 PM8/1/15
to Google Visualization API
Hi Tong,

The abbreviation 'vAxis.baseline' actually means 'vAxis: { baseline: 0 }', though this is not particularly clear.  It works though: https://jsfiddle.net/cL2q5p1z/2/

--
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-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.



--
dlaliberte@Google.com   5CC, Cambridge MA
daniel.laliberte@GMail.com 9 Juniper Ridge Road, Acton MA

Tong Sun

unread,
Aug 1, 2015, 4:53:57 PM8/1/15
to google-visua...@googlegroups.com
Ah, thanks a lot Daniel! Have a nice weekend. 

--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/vRNJUk9aZUI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.

Naresh Gupta

unread,
Nov 20, 2018, 12:21:08 AM11/20/18
to Google Visualization API
Hi Daniel,
Even though I used the below code,it didn't worked out for me and the script i am using is <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> where as in the jsfiddle its showing the old one.
Can you please give the latest solution for forcing the combo chart to start from zero for y-axis.

Thanks,
Naresh Gupta


On Sunday, 2 August 2015 00:28:44 UTC+5:30, Daniel LaLiberte wrote:
Hi Tong,

The abbreviation 'vAxis.baseline' actually means 'vAxis: { baseline: 0 }', though this is not particularly clear.  It works though: https://jsfiddle.net/cL2q5p1z/2/
On Sat, Aug 1, 2015 at 11:27 AM, Tong Sun <sunto...@gmail.com> wrote:
Hi, 

Google Chart will automatically raise the Y-axis' minimum value, so as to emphasis there differences. 

This is what I mean -- in https://jsfiddle.net/cL2q5p1z/1/, you can see that Y-axis' minimum value is 1.400,000. How to force it to zero, so as to emphasis on the comparative total size?

and found,

vAxis.baseline: vAxis property that specifies the baseline for the vertical axis.

so I tried to use "vAxis.baseline: 0," as shown in the jsfiddle, but that gave me an empty chart. 

Please help. 
Thanks


--
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-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.



--
dlali...@Google.com   5CC, Cambridge MA
daniel.l...@GMail.com 9 Juniper Ridge Road, Acton MA

Daniel LaLiberte

unread,
Nov 20, 2018, 11:07:35 AM11/20/18
to google-visua...@googlegroups.com
Here is the same code updated to use the latest version: https://jsfiddle.net/dlaliberte/cL2q5p1z/99/

On Tue, Nov 20, 2018 at 12:21 AM Naresh Gupta <naresh.m...@gmail.com> wrote:
Hi Daniel,
Even though I used the below code,it didn't worked out for me and the script i am using is <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> where as in the jsfiddle its showing the old one.
Can you please give the latest solution for forcing the combo chart to start from zero for y-axis.

Thanks,
Naresh Gupta

On Sunday, 2 August 2015 00:28:44 UTC+5:30, Daniel LaLiberte wrote:
Hi Tong,

The abbreviation 'vAxis.baseline' actually means 'vAxis: { baseline: 0 }', though this is not particularly clear.  It works though: https://jsfiddle.net/cL2q5p1z/2/
On Sat, Aug 1, 2015 at 11:27 AM, Tong Sun <sunto...@gmail.com> wrote:
Hi, 

Google Chart will automatically raise the Y-axis' minimum value, so as to emphasis there differences. 

This is what I mean -- in https://jsfiddle.net/cL2q5p1z/1/, you can see that Y-axis' minimum value is 1.400,000. How to force it to zero, so as to emphasis on the comparative total size?

and found,

vAxis.baseline: vAxis property that specifies the baseline for the vertical axis.

so I tried to use "vAxis.baseline: 0," as shown in the jsfiddle, but that gave me an empty chart. 

Please help. 
Thanks


--
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-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.



--
dlali...@Google.com   5CC, Cambridge MA
daniel.l...@GMail.com 9 Juniper Ridge Road, Acton MA

--
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-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--

Naresh

unread,
Nov 20, 2018, 11:27:00 AM11/20/18
to google-visua...@googlegroups.com
Hi Daniel,I have used the following data and code,but still negative numbers are displaying for the yaxis.Can you please look into this as I dont need to display negative values in the chart

google.charts.load('current', {
  'packages': ['corechart']
});
google.charts.setOnLoadCallback(drawVisualization);

function drawVisualization() {
  // Some raw data (not necessarily accurate)
  var data = google.visualization.arrayToDataTable([
    ['Method', 'Result size', 'conversion time (in seconds)'],
    ['veryfast', 0, 0],
    ['faster', 0, 0],
    ['fast', 0, 0],
    ['medium', 0, 0],
    ['slow', 0, 0],
    ['slower', 0, 0],
    ['veryslow', 0, 0]
  ]);

  var options = {
    title: 'ffmpeg preset comparison',
    vAxes: {
      // Adds titles to each axis.
      0: {
        title: 'Size',
        baseline: 0
      },
      1: {
        title: 'Time'
      }
    },
    //vAxis.baseline: 0,
    hAxis: {
      title: 'Method'
    },
    vaxis:{
    viewWindowMode:'explicit',
    viewWindow:{min:0}
    },
    pointSize: 5,
    curveType: 'function',
    seriesType: 'bars',
    series: {
      5: {
        type: 'line',
        targetAxisIndex: 1
      }
    }
  };

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


Daniel LaLiberte

unread,
Nov 20, 2018, 11:34:53 AM11/20/18
to google-visua...@googlegroups.com
The 'function' curve can result in negative values being generated, unfortunately.  But you can force a cut-off of all negative values, if you want, by using the viewWindow.min option, set to 0.  


For more options, visit https://groups.google.com/d/optout.

Naresh

unread,
Nov 20, 2018, 11:41:59 AM11/20/18
to google-visua...@googlegroups.com
I have already kept viewWindow.min to 0 in the vaxis,but still not able to cut-off the negative values.Please check my code once .

Daniel LaLiberte

unread,
Nov 20, 2018, 11:48:11 AM11/20/18
to google-visua...@googlegroups.com
You have 2 vAxes, so you will have to constrain both of them since the each have a separate viewWindow. Hope that helps.


For more options, visit https://groups.google.com/d/optout.

Naresh

unread,
Nov 20, 2018, 11:52:46 AM11/20/18
to google-visua...@googlegroups.com
Yes I get you but can u help me in my code how to set the constrain for both of them,so that it will be greatful for me to solve the problem

Daniel LaLiberte

unread,
Nov 20, 2018, 12:30:28 PM11/20/18
to google-visua...@googlegroups.com
vAxes: {
      // Adds titles to each axis.
      0: {
        title: 'Size',
        baseline: 0,
        viewWindow: { min: 0 }
      },
      1: {
        title: 'Time',
        viewWindow: { min: 0 }
      }
    },


For more options, visit https://groups.google.com/d/optout.

Naresh

unread,
Nov 20, 2018, 11:43:06 PM11/20/18
to google-visua...@googlegroups.com
Hi Daniel,
Now I am getting other error as "Uncaught TypeError: google.setOnLoadCallback is not a function" and the chart is not displaying.The following is the code:

google.charts.load('current', {
  'packages': ['corechart']
});
google.setOnLoadCallback(drawVisualization);
    
    function drawVisualization() {
        // Some raw data (not necessarily accurate)
        var data = google.visualization.arrayToDataTable([
            ['Method', 'Result size', 'conversion time (in seconds)'],
            ['veryfast',   0,    0],
            ['faster',     0,    0],
            ['fast',       0,    0],
            ['medium',     0,   0],
            ['slow',       0,   0],
            ['slower',     0,   0],
            ['veryslow',   0,  0]
        ]);
            
        var options = {
            title : 'ffmpeg preset comparison',
           vAxes: {
      // Adds titles to each axis.
      0: {
        title: 'Size',
        baseline: 0,
        viewWindow: { min: 0 }
      },
      1: {
        title: 'Time',
        viewWindow: { min: 0 }
      }
    },
            //vAxis.baseline: 0,
            hAxis: {title: 'Method'},
             vAxis: {

Naresh

unread,
Nov 20, 2018, 11:54:55 PM11/20/18
to google-visua...@googlegroups.com
Sorry for the confusion.I have changed the  google.setOnLoadCallback(drawVisualization); to  google.charts.setOnLoadCallback(drawVisualization); then it worked well for me.But still I am able to display the negative values even though I have added 
vAxes: {
      // Adds titles to each axis.
      0: {
        title: 'Size',
        baseline: 0,
        viewWindow: { min: 0 }
      },
      1: {
        title: 'Time',
        viewWindow: { min: 0 }
      }
    },

Please check again.

Daniel LaLiberte

unread,
Nov 21, 2018, 9:16:49 AM11/21/18
to google-visua...@googlegroups.com
Interesting.  It appears there is a bug when you only have one data value, specifically the value 0.  In that case, the viewWindow is overridden to show the range -1 to 1.  This is a new bug, actually, which I should be able to fix (maybe very soon, depending on the cause).  But if you want this to work now, you can change 'current' to '45.2'.


For more options, visit https://groups.google.com/d/optout.

Daniel LaLiberte

unread,
Nov 21, 2018, 9:53:16 AM11/21/18
to google-visua...@googlegroups.com
Even more curious, if you *don't* specify any viewWindow.min option, then you will get a single '0' tick on the vertical axis and a single gridline at your baseline value of 0.  This may be another workaround for you.

Why specifying the viewWindow.min causes this, I don't know yet. But the single value (when you don't specify the viewWindow option) is a feature, since we don't know what the range of the axis should be with only one value.

Naresh

unread,
Nov 21, 2018, 11:17:37 AM11/21/18
to Google Visualization API
I have once again tried with values "0" and not used vaxis.min option.Even then i got the same result(getting negative values in the yaxis).

    pointSize: 5,
    curveType: 'function',
    seriesType: 'bars',
    series: {
      1: {
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-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.



--
dlali...@Google.com   5CC, Cambridge MA
daniel.l...@GMail.com 9 Juniper Ridge Road, Acton MA

--
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.

--
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.

--
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.

--
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.

--
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.

--
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.

--
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.

--
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.

--
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.

Daniel LaLiberte

unread,
Nov 21, 2018, 12:40:25 PM11/21/18
to google-visua...@googlegroups.com
Here is a jsfiddle of your chart, with no viewWindow options.  There is only one gridline at '0'.


To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.



--
dlali...@Google.com   5CC, Cambridge MA
daniel.l...@GMail.com 9 Juniper Ridge Road, Acton MA

--
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-visualizati...@googlegroups.com.


--

--
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-visualizati...@googlegroups.com.

--
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-visualizati...@googlegroups.com.


--

--
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-visualizati...@googlegroups.com.

--
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-visualizati...@googlegroups.com.


--

--
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-visualizati...@googlegroups.com.

--
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-visualizati...@googlegroups.com.


--

--
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-visualizati...@googlegroups.com.

--
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-visualizati...@googlegroups.com.

--
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-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.

For more options, visit https://groups.google.com/d/optout.


--

Andrey Izman

unread,
Jul 11, 2019, 12:18:15 PM7/11/19
to Google Visualization API
It does not work, even in your jsfiddle


On Wednesday, November 21, 2018 at 7:40:25 PM UTC+2, Daniel LaLiberte wrote:
Here is a jsfiddle of your chart, with no viewWindow options.  There is only one gridline at '0'.


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-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.



--
dlali...@Google.com   5CC, Cambridge MA
daniel.l...@GMail.com 9 Juniper Ridge Road, Acton MA

--
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.


--

--
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.

--
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.


--

--
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.

--
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.


--

--
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.

--
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.


--

--
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.

--
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.

--
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.

Daniel LaLiberte

unread,
Jul 11, 2019, 12:38:20 PM7/11/19
to Google Visualization API
This situation, with only a single 0 data value, is a non-typical edge case that I am not too concerned about.  I'll revisit this at some point in the future, but it is rather low priority.  Do you have an application where this because a problem, or is it merely an annoyance.

To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.



--
dlali...@Google.com   5CC, Cambridge MA
daniel.l...@GMail.com 9 Juniper Ridge Road, Acton MA

--
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-visualizati...@googlegroups.com.


--

--
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-visualizati...@googlegroups.com.

--
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-visualizati...@googlegroups.com.


--

--
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-visualizati...@googlegroups.com.

--
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-visualizati...@googlegroups.com.


--

--
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-visualizati...@googlegroups.com.

--
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-visualizati...@googlegroups.com.


--

--
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-visualizati...@googlegroups.com.

--
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-visualizati...@googlegroups.com.

--
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-visualizati...@googlegroups.com.

--
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-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.

For more options, visit https://groups.google.com/d/optout.


--

Andrey Izman

unread,
Jul 11, 2019, 12:45:34 PM7/11/19
to Google Visualization API
Thank you for fast reply.
Yes, I have an application with only 0 values for some cases, maybe it's not typical but it's really annoying.
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-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.



--
dlali...@Google.com   5CC, Cambridge MA
daniel.l...@GMail.com 9 Juniper Ridge Road, Acton MA

--
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.


--

--
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.

--
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.


--

--
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.

--
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.


--

--
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.

--
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.


--

--
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.

--
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.

--
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.

--
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.

Ken Wagnitz

unread,
Jul 24, 2019, 9:09:58 PM7/24/19
to Google Visualization API
On Friday, 12 July 2019 02:08:20 UTC+9:30, Daniel LaLiberte wrote:
This situation, with only a single 0 data value, is a non-typical edge case that I am not too concerned about.  I'll revisit this at some point in the future, but it is rather low priority.  Do you have an application where this because a problem, or is it merely an annoyance.

Its not a single edge case.  I am plotting rainfall, which is often zero.  Many graphs would show zero values.
On my graph, when the rainfall is zero, it shows vertical axes of -1.0 to 1.0, which looks pretty silly.  So vAxis: { viewWindow: { min: 0 } } just doesn't work.

Ken Wagnitz

unread,
Jul 24, 2019, 9:41:09 PM7/24/19
to Google Visualization API
BTW on this page:  https://developers.google.com/chart/interactive/docs/gallery/linechart
I assume   "vAxis.viewWindow.min The minimum horizontal data value to render."   is a copy/paste error?

And WRT my comment above, I'm using a line chart.

Peter L

unread,
May 6, 2020, 5:54:25 PM5/6/20
to Google Visualization API
I'm wondering if this has been addressed yet, have the same issue i both column and line charts

Martin Ballestero

unread,
Aug 6, 2021, 1:59:29 PM8/6/21
to Google Visualization API
Hello everyone,
I know this issue is old but still can notice this bug. I create the issue at GitHub because didn't found someone related: https://github.com/google/google-visualization-issues/issues/2924
Also, there's a workaround defining vAxis.minValue or vAxis.maxValue to 1.0.

I hope this issue gets noticed and fixed, because I consider it's not an edge case to have a chart with only zero values and Y-axis representing for example, quantities (no negative values).

Thank you.

Reply all
Reply to author
Forward
0 new messages