Open orwant opened 9 years ago
I worked around this issue by not initializing my chart via "google.visualization.ChartWrapper."
In my case I was using ChartWrapper to create a tree map chart. I swapped that out
for "google.visualization.TreeMap." This initialization method takes some different
parameters but I was able to produce the results I wanted. I hope this helps you.
Original issue reported on code.google.com by Ryan.Marr934
on 2015-02-20 18:49:55
I suspect that people who are getting the 'container is null' message are using jQuery
to provide the element, and it is not a proper element for this purpose, which is especially
important for the ChartWrapper. I am curious if it works when you get the actual element
(using jQuery .get()).
Original issue reported on code.google.com by dlaliberte@google.com
on 2015-02-20 19:10:48
dlalibe, I was using the containerId property. I wasn't passing a jQuery or a DOM element
and it worked fine until a day or two ago.
Original issue reported on code.google.com by Ryan.Marr934
on 2015-02-20 19:17:58
With the ChartWrapper,
I have fixed the problem by removing the parameters of the 'draw' method.
var chart = new google.visualization.ChartWrapper({'dataTable': dataTable, 'options'
: {...}, ...});
chart.draw();
Original issue reported on code.google.com by jolan.teinturier@ipa-consulting.fr
on 2015-02-20 19:18:59
jolan
I have fixed the problem with you tip.
That problem was driving me crazy because everything was fine until two days ago.
Thanks a lot
Leo from Brazil
Original issue reported on code.google.com by djleoaz
on 2015-02-20 19:46:03
Jolan, and djleoaz, I am curious what parameter were you giving to the draw method?
It should have been a container element or an id. Perhaps it ignored non-elements
in the past, but now it causes an error. We could probably have it ignore the parameter
if it is not a string and not an element.
Original issue reported on code.google.com by dlaliberte@google.com
on 2015-02-20 19:52:33
I just gave the datatable.
But, it's useless, we already give it at the creation of the wrapper.
chart.draw(dataTable);
Original issue reported on code.google.com by jolan.teinturier@ipa-consulting.fr
on 2015-02-20 20:05:08
I found the same problem just yesterday. Must be some changes in the API library.
Original issue reported on code.google.com by arbeiv
on 2015-02-20 21:56:02
dlalibe
I used to pass the datatable as parameter to the method draw.
chart.draw(dataTable);
Thanks
Original issue reported on code.google.com by djleoaz
on 2015-02-21 15:10:38
This happened to me last week too. i believe the chartwrapper .draw() method was redefined.
At some point in the past, it required a Chart object (and, I think, accepted an optional
chart options object). Now the documentation says it accepts an optional container
Id string... Code written against the previous version will result in an error because
the chart object isn't a containerid.
Maybe there was an undocumented update? I know my chart was working for some time after
the last reported update (October)
Original issue reported on code.google.com by bagleworm
on 2015-02-22 14:48:17
Correction: Maybe it was a datatable object, not a chart object that the old .draw()
method required. Either way, not a string!
Original issue reported on code.google.com by bagleworm
on 2015-02-22 14:50:14
Bagleworm, it seems most people expected the datatable object should be passed to the
draw() method, as it is for regular charts. But a ChartWrapper is not actually a chart
itself, and I believe the ChartWrapper draw method never allowed a datatable object,
but always expected a container element id. Now that it also allows a container element,
it gets confused if you give it something else.
We can make a change that ignores the parameter if it is not a proper element or id,
but since this is more of a user error, I don't think we will make the change at this
time. The error message should probably be more specific, however. E.g. 'ChartWrapper
expects a container element or id'
Original issue reported on code.google.com by dlaliberte@google.com
on 2015-02-22 17:14:36
Ah, fantastic, thank you for the correction and clarification! I agree that changing
the error message to what you suggested would be very helpful.
Original issue reported on code.google.com by bagleworm
on 2015-02-22 22:16:30
Original issue reported on code.google.com by
equere21
on 2015-02-19 19:16:47