using java data source library with annotated time line graph

51 views
Skip to first unread message

Suresh

unread,
Nov 6, 2009, 6:53:12 PM11/6/09
to Google Visualization API
Hi I am using java data source library and i have confusion
data = new DataTable();
ArrayList cd = new ArrayList();
cd.add(new ColumnDescription("Date Time",
ValueType.DATETIME, "Date Time"));
cd.add(new ColumnDescription("column1", ValueType.NUMBER,
"column1"));
cd.add(new ColumnDescription("column2", ValueType.NUMBER,
"column2"));

i am doing the annotated timeline and when i am adding rows i am
having hard time because some of the data points are not having values
for column1.So how i can skip the data in the row and add in column2.


I would appreciate your help.

Suresh

Bug Chart

unread,
Nov 9, 2009, 6:01:49 AM11/9/09
to google-visua...@googlegroups.com
Hi,

just add dummy data for column1, or null.

HTH

BugChart

Suresh

unread,
Nov 11, 2009, 2:13:59 PM11/11/09
to Bug Chart, google-visua...@googlegroups.com
i tried row.addCell(null); this but it is showing a compilation
error.
Adding a dummy data is a false approach as it would mislead the graph.

i feel funny and baffled because i am able to skip the data using
javascript as shown below by not passing anything for column1 but
could not find any answer using java data source library.

data.addColumn('date', 'Date');
data.addColumn('number', 'Sold Pencils');
data.addColumn('number', 'Sold Pens');

data.addRows([
[new Date(2008, 1 ,1), 30000,200],
[new Date(2008, 1 ,2), ,300],
[new Date(2008, 1 ,3), 55022,400],
[new Date(2008, 1 ,4), ,450],
]);

Suresh

unread,
Nov 11, 2009, 2:18:02 PM11/11/09
to Suresh, google-visua...@googlegroups.com
i also tried the below option by passing null and i am getting Type
missmatch exception.Is there a way to set an emty cell using java.

data.addRowFromValues(,,null,);

PASUPULETI SURESH

unread,
Nov 11, 2009, 2:58:03 PM11/11/09
to bugc...@google.com, google-visua...@googlegroups.com
I am able to overcome the problem.

kenkuyo

unread,
Nov 24, 2009, 11:39:18 PM11/24/09
to Google Visualization API
how did u do it?

On Nov 11, 11:58 am, PASUPULETI SURESH <suresh.pasupul...@gmail.com>
wrote:
> I am able to overcome the problem.
>

PASUPULETI SURESH

unread,
Nov 25, 2009, 5:37:37 AM11/25/09
to google-visua...@googlegroups.com

Keep the data.addRowformatValues in the try catch as below.Hope this helps.

 try {
                         data.addRowFromValues(dt.getCalendar(),null)

                    } catch(TypeMismatchException tm){
                    System.out.println("i >"+i);

                    }

Thanks
Suresh

--

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.



Reply all
Reply to author
Forward
0 new messages