Time line charts- Loading Data tbale

31 views
Skip to first unread message

Mychart

unread,
Aug 1, 2018, 5:15:56 AM8/1/18
to Google Visualization API
Team ,

Am using Timeline charts. I have to use columns of type (string,date,date)  in my data table.. I understand the argument need to be of type Java script Date type.
Am fetching values from data base and storing in a data structure arraylist. 

Then I iterate the arraylist and take needed values and pass into data.addRow  function.


But am not getting the needed result,

loop  :

                      task ='<%=myData.get(loopcount).toString()%>';        
                     start=new Date(<%=myData.get(loopcount+1).toString()%>); 
                     end = new Date(<%= myData.get(loopcount+2).toString()%>);  


                   data.addRow([task,start,end]); 

end loop.

Arraylist contents

[20-01-2018,10-01-2018, 20-02-2018, TASk2, 11-02-2018, 21-03-2018, TASK3, 15-03-2018, 19-04-2018]







Abhi Venugopal

unread,
Aug 1, 2018, 6:32:10 AM8/1/18
to google-visua...@googlegroups.com

Hi All,


Am trying to create a timeline chart using Google chart API.


My data source is a ArrayList in Java holding these values .
[TASK1,10-01-2018, 20-02-2018, TASk2, 11-02-2018, 21-03-2018, TASK3, 15-03-2018, 19-04-2018]


In My Page that need to  render the chart
1. I tried chart populating dataTable
2. Also Tried creating an Array and  populating dataTable using array.



Please find the Chart generation   page and the output attached .



In both cases am not getting the put put as required.  The X axis values am expecting to me  months and year 
Please help me to fix this.

















chart.2jsp.txt
chart.jsp.txt
Reply all
Reply to author
Forward
0 new messages