Google Visualization: SetValue and SetCell

1,035 views
Skip to first unread message

tomysshadow

unread,
Sep 7, 2011, 2:51:21 PM9/7/11
to Google Visualization API
Hi,
I have been using the google visualization package for a while to make
pie and bar charts, thanks it works great. But I was wondering, in the
gauge coding example, at http://code.google.com/apis/chart/interactive/docs/examples.html
under the gauge section, first you create some empty columns and rows,
and then use setCell() to set values. But later on, setValue() is used
to set values. What is the difference between the two? The datatables
and dataviews page http://code.google.com/apis/chart/interactive/docs/datatables_dataviews.html
makes it even more confusing, since it says to use addValue() in the
title, and uses setCell() in the example. So overall, you could use
setCell(), addValue() or setValue()? I'm confused.

Please help me someone? All I want to know is what's the difference...
Thanks,
Tommy

EZChart

unread,
Sep 8, 2011, 7:13:33 AM9/8/11
to google-visua...@googlegroups.com
  • addValue() is just a plain mistake in the documentation - it does not exist. We will fix this soon.
  • setValue() is the same as calling setCell() without passing the optional parameters.
  • er


--
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.


EZChart

unread,
Sep 8, 2011, 7:16:33 AM9/8/11
to google-visua...@googlegroups.com
Oops, sent email in the middle of writing it by mistake. Rewriting:
  • addValue() is just a plain mistake in the documentation - it does not exist. We will fix this soon.
  • setValue() is the same as calling setCell() without passing the optional parameters.
So, if you want to use the optional parameters of setCell() you should definitely use setCell(). If you just want to set the value, you can use either setCell() or setValue() - they're exactly the same.

tomysshadow

unread,
Sep 13, 2011, 8:14:57 PM9/13/11
to Google Visualization API
Hi! Sorry for the late reply, and thanks for the answer. Just
wondering: I can't find the list of parameters anywhere. What are the
optional parameters of SetCell? As far as I can tell from the
examples, the only difference is setting a string instead of a number
in a table.

About the addValue() thing - that's good to know! :) I like this API.

On Sep 8, 5:16 am, EZChart <ezch...@google.com> wrote:
> Oops, sent email in the middle of writing it by mistake. Rewriting:
>
>    - addValue() is just a plain mistake in the documentation - it does not
>    exist. We will fix this soon.
>    - setValue() is the same as calling setCell() without passing the
>    optional parameters.
>
> So, if you want to use the optional parameters of setCell() you should
> definitely use setCell(). If you just want to set the value, you can use
> either setCell() or setValue() - they're exactly the same.
>
>
>
>
>
>
>
> On Thu, Sep 8, 2011 at 2:13 PM, EZChart <ezch...@google.com> wrote:
>
> >    - addValue() is just a plain mistake in the documentation - it does not
> >    exist. We will fix this soon.
> >    - setValue() is the same as calling setCell() without passing the
> >    optional parameters.
> >    - er
>
> > On Wed, Sep 7, 2011 at 9:51 PM, tomysshadow <ellesc...@gmail.com> wrote:
>
> >> Hi,
> >> I have been using the google visualization package for a while to make
> >> pie and bar charts, thanks it works great. But I was wondering, in the
> >> gauge coding example, at
> >>http://code.google.com/apis/chart/interactive/docs/examples.html
> >> under the gauge section, first you create some empty columns and rows,
> >> and then use setCell() to set values. But later on, setValue() is used
> >> to set values. What is the difference between the two? The datatables
> >> and dataviews page
> >>http://code.google.com/apis/chart/interactive/docs/datatables_datavie...

EZChart

unread,
Sep 14, 2011, 12:59:15 AM9/14/11
to google-visua...@googlegroups.com

tomysshadow

unread,
Sep 14, 2011, 6:07:34 PM9/14/11
to Google Visualization API
Thanks for your help, that made much more sense!

On Sep 13, 10:59 pm, EZChart <ezch...@google.com> wrote:
> Take a look at the API reference underhttp://code.google.com/apis/chart/interactive/docs/reference.html#Dat...
> .
Reply all
Reply to author
Forward
0 new messages