ChartWrapper giving [object Object] does not fit the Control specification error

1,316 views
Skip to first unread message

MrTik

unread,
Dec 29, 2011, 7:32:18 PM12/29/11
to Google Visualization API
Here is the code that I am trying to render, however I get the
mentioned error.

function rDetailQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' '
+response.getDetailedMessage());
return;
}
mResultDetails = response.getDataTable();
var mDrawData2 = new
google.visualization.Table(document.getElementById('visualization2'));

mDataJoin = new
google.visualization.data.join(mResultDetails,mDriverName,'left',
[[1,1],[2,2],[3,3],[4,4]],[5,6,7,8,9,10,11,12,13,14,15,16],[5]);

// Define a chart to show data
var columnChart = new google.visualization.ChartWrapper({
'chartType': 'ColumnChart',
'containerId': 'chart3',
'options': {
'width': 1500,
'height': 800,
'legend': 'right',
'isStacked': true,
'title': 'Forward Costs Initiatives Impact',
'seriesType': 'bars',
'series': {7: {type: 'line'}, 8: {type: 'line'}, 9: {type:
'line'}}
},
// Configure the barchart to use columns
'view': {'columns': [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]}
});

//Define a table
var table = new google.visualization.ChartWrapper({
'chartType': 'Table',
'containerId': 'chart2',
'options': {
'width': '1500'
},
// Configure the barchart to use columns
'view': {'columns': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14]}
});

new
google.visualization.Dashboard(document.getElementById('visualization')).bind([columnChart,
table]).draw(mDataJoin);

}

Any thoughts as to why I would get this error?

Thanks.

ChartMan

unread,
Dec 30, 2011, 7:04:43 AM12/30/11
to google-visua...@googlegroups.com

Hey

If you look up the API you can see that you bind control/s to chart/s. The example below tries to bind two charts which is probably the cause for this error.

HTH
ChartMan

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

MrTik

unread,
Jan 3, 2012, 2:06:27 PM1/3/12
to Google Visualization API
Ok, I understand that. Thanks.

What if I just want to display the chart with out directly connected
to a control. Would it be possible to do that?

Thanks.

On Dec 30 2011, 4:04 am, ChartMan <chart...@google.com> wrote:
> Hey
>
> If you look up the API you can see that you bind control/s to chart/s. The
> example below tries to bind two charts which is probably the cause for this
> error.
>
> HTH
> ChartMan

asgallant

unread,
Jan 3, 2012, 2:34:52 PM1/3/12
to google-visua...@googlegroups.com
You can do that, but not in the context of a Dashboard (at least, not insofar as I am aware).  You can specify the data source for each chart in the ChartWrapper declaration, and then call the #draw() method of each wrapper individually.
Reply all
Reply to author
Forward
0 new messages