combo chart throwing data type errors

57 views
Skip to first unread message

dunba...@gmail.com

unread,
Dec 15, 2015, 2:18:26 PM12/15/15
to Google Visualization API
Hi, 
I am trying to create a combo chart with a continuous time x axis that has seriesType: 'bars' and series: {11: {type: 'area', color: 'red'}} for the last set of data. I am running this off a dataTable obtained from a Google sheet that has dates in the first column and numbers in the remaining columns. However, I keep getting ''All series on a given axis must be of the same data type' errors. What am I doing wrong? 
These are the chart options I am using via ChartWrapper: 

chartType: 'ComboChart',
        containerId: 'chart_div',
        dataTable: data,
        options: {
            title: 'combo chart',
            width: 800,
            height: 400,
   backgroundColor: 'transparent',
   interpolateNulls: true,
seriesType: 'bars',
series: {11: {type: 'area', color: 'red'}}
        }

All help appreciated. 
Nick 

Daniel LaLiberte

unread,
Dec 15, 2015, 3:05:23 PM12/15/15
to Google Visualization API
Hi Nick,

We can't tell what might be going wrong just by looking at your options.  Since it is complaining about your data columns, you should check that, in fact, all your columns after the first really are numbers.  If you formatted some as strings, or if you have columns outside the range you thought you were using, that could explain the error.  
One easy way to check this is to use a Table chart instead of your ComboChart.  

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/b446fca1-3007-4ec7-b091-ead67a6d4614%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Nick Dunbar

unread,
Dec 15, 2015, 5:21:52 PM12/15/15
to google-visua...@googlegroups.com
Hi Daniel, 
Apart from the first column they are all numbers. I replaced nulls with zeroes in the Excel sheet I pasted into the Google sheet, and they look kosher. I will try to put together a fiddle. 
Best, 
Nick 

--
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/5CFWLN7PlBg/unsubscribe.
To unsubscribe from this group and all its topics, 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.

Nick Dunbar

unread,
Dec 15, 2015, 5:30:32 PM12/15/15
to google-visua...@googlegroups.com
Daniel, 
It's working now. I had an additional last column for tooltip in the Google sheet with the heading 
{type:'string',role:'tooltip'}
 which seemed to be triggering the error. 
Do you know how to format a tooltip column in the Google sheet so it loads correctly into the dataTable? 
Thanks for your help
Nick 

Daniel LaLiberte

unread,
Dec 15, 2015, 7:51:06 PM12/15/15
to Google Visualization API
Unfortunately, I believe there is no option in Sheets to specify that a column is for tooltips.  If the whole column is formatted as a strings, then it will probably be used as annotations for the preceding column.


For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages