Hi Frank, The issue here is that dates don't really have a "0" value, and so are not really additive. For example, if you add Jan 1, 2013 and Jan 1, 2014, what date should you get? Should we use the max date and get Jan 1, 2014? Or add all the individual numbers and get Feb 2, 4027? Neither seems quite right. Things get even more strange if you try to add Jan 1, 1 AD, and Jan 1, 1 BC. Should you get Jan 1, 0 AD?
To circumvent this issue, you can use the timeofday format, which represents a relative time (which can also be viewed as a time duration), for example, 1 day and 1 hour. It is much more straightforward to see how those would be added. Please let us know if you have further questions. On Mon Dec 29 2014 at 3:36:17 AM Frank <[email protected]> wrote: > I'm sorry that I'm not good at English. > The graph is correct with the following code. But I want the number > columns to be stacked, so I add "isStacked: true," into options. And then, > the right vAxis is wrong. > Date vAxis can not be shown correctly with "isStacked:true" in Combo > Chart? > CODE: > <!DOCTYPE HTML> > <html> > <head> > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> > <title>Test</title> > <script src="http://www.google.com/jsapi"></script> > <script type="text/javascript"> > google.load('visualization', '1', {packages: ['corechart']}); > google.setOnLoadCallback(drawVisualization); > > function drawVisualization() { > // Some raw data (not necessarily accurate) > var data = google.visualization.arrayToDataTable([ > ['Month', 'num1', 'num2', 'date'], > ['2004/05', 165, 938, new Date(1419779800000)], > ['2004/05', 165, 938, new Date(1419788800000)], > ['2004/05', 165, 938, new Date(1419798800000)], > ['2004/05', 165, 938, new Date(1419779800000)] > ]); > > var options = { > title : 'Monthly Coffee Production by Country', > vAxis: {}, > vAxes: {0:{gridlines:{count:4}},1:{gridlines:{count:4}}}, > hAxis: {title: "Month"}, > seriesType: "bars", > series: {0: {targetAxisIndex: 0},1: {targetAxisIndex: 0},2: {type: > "line",targetAxisIndex: 1}} > }; > var chart = new > google.visualization.ComboChart(document.getElementById('chart_div')); > chart.draw(data, options); > } > </script> > </head> > <body> > <div id="chart_div" style="width: 900px; height: 500px;"></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 > http://groups.google.com/group/google-visualization-api. > For more options, visit https://groups.google.com/d/optout. > -- 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 http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.
