To get multiple series in the chart, you have to pivot your data so that each CPU gets its own column. MySQL does not have a pivot function, so you have to do it manually:
SELECT TimeStamp, SUM(IF(ID = 'CPU1', Speed, 0)) AS CPU1, SUM(IF(ID = 'CPU2', Speed, 0)) AS CPU2, etc... FROM <table name> GROUP BY TimeStamp This does require that you know ahead of time what all the values of ID can be, but you can acquire this by querying the database before generating the pivot query if necessary. There are a ton of posts in this forum and on StackOverflow explaining how to convert output from a database into a DataTable in a multitude of different systems. On Friday, March 7, 2014 6:45:52 PM UTC-5, Bruno Carvalho wrote: > > Hello, > > I have googled alot and the answers i have found didn't satisyed me. > I have a MySQL table called cpu_speed wish looks like this: > > | TimeStamp | ID | Speed > | 1394231304 | CPU2 |31.78 > | 1394231497 | global |69.56 > | 1394235469 | CPU1 |38.56 > | 1394235472 | global |59.02 > > This table can hold values from multiple CPU's. > > How can i generate a Graph like this: > > https://google-developers.appspot.com/chart/interactive/docs/gallery/linechart > > Using those values? > > I want a graph line for each CPU. > > Best regards. > -- 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/d/optout.
