Hi Tong,

The reason for this is because arrayToDataTable attempts to infer the types
of your data. So when you attempt to use it with just the header row, it
infers the types of all the columns to be string (the default type). You
can fix your first example by creating the DataTable via the DataTable
constructor and using addColumn to add all the columns and specify their
types. It's generally not advised to mix usage of arrayToDataTable and
addRows.

You can "set/reset chart data" simply by calling chart.draw with a
different DataTable and/or options, or even the same DataTable with
modified data.

On Thu Feb 05 2015 at 6:09:33 PM Tong Sun <[email protected]> wrote:

> Hi,
>
> Please take a look at the following jsfiddle:
>
> http://jsfiddle.net/12r0ztoa/1/
> http://jsfiddle.net/849tL2k8/1/
>
> The only difference between the two is whether "var data" was initially
> empty or not. Yet, one is working while the other one isn't. Why is that?
>
> How to set/reset chart data using another data array?
>
> 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 [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.

Reply via email to