If I understand your question correctly, you're asking what should be the
formatted value for values of type string, in the JSon format.

So, the answer is simple.
If formatted value is omitted (or null) then it is taken to be some string
representation of the value. For string types, naturally, this generated
formatted value will be identical to the value.
So all these will be the same:
{v: 'foo', f: 'foo'}
{v: 'foo', f: null}
{v: 'foo'}

Of course if you want you could have {v: 'foo', f: 'bar'} but that may lead
to confusion, depending on which visualization you're using, or what you're
doing with the data, etc.

Hope this answers your question.

- VizBoy.

On Wed, Jan 28, 2009 at 1:09 PM, _alee <[email protected]>wrote:

>
> Hi,
>
> I am generating the JSON using Struts 2 plugin. It automatically
> generates the JSON value:key pair for given bean.
>
> To generated JSON for each value in a column i have created a bean
>
> public class RowVO {
>        private String v;       //value
>        private String f;       //format
>
>        public RowVO(String format, String value) {
>                this.f = format;
>                this.v = value;
>        }
>        public String getV() {
>                return v;
>        }
>        public void setV(String v) {
>                this.v = v;
>        }
>        public String getF() {
>                return f;
>        }
>        public void setF(String f) {
>                this.f = f;
>        }
> }
>
> it generates Perfect required v:f pair. For every data i specify V and
> F. I am confuse what should i set the F value for "string" value?
>
> I google example i have seen that F is omitted for the values which
> are in string. but in this case i can't omit it since these are being
> generated by Struts2. So what should i do?
> >
>

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

Reply via email to