Yes, you can do that with DataViews<https://developers.google.com/chart/interactive/docs/reference#DataView> .
// data is the DataTable // create a view showing ID and Value1 var view1 = new google.visualization.DataView(data); view1.setColumns([0, 1]); // draw LineChart with view1 instead of data // create a view showing TimeStamp, Value2, and Value3: var view2 = new google.visualization.DataView(data); view2.setColumns([4, 2, 3]); // sort view2 by DateStamp view2.setRows(view2.getSortedRows([0])); // draw BarChart with view2 instead of data On Monday, September 16, 2013 4:12:08 AM UTC-4, Starry SHI wrote: > > Hi! > > I have a dataTable with multiple columns, and I would like to use the same > dataTable for different visualizations. > > For example, my dataTable is with the following columns: > ID, Value1, Value2, Value3, TimeStamp > > And I want to visualize all Value1 for all IDs in line chart, and > visualize Value1, Value2, Value3 according to timestamps in bar charts. How > can I do this with using the same dataTable? > > Also, I want to ask if it is possible to select TimeStamp as the x-axis, > although it does not appear in the first column of the dataTable. > > Thank you for your attention! > > -- 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/groups/opt_out.
