php - how do I chart this data with the google chart api? -
Hello, I have a query that I have run with mysql and I need to chart the data. Someone can tell me how I can format output to PHP and give it to Google with the correct and syntax - I have tried everything, but there is no happiness.
There will be a code sample if it is possible to actually be useful, ideally I want a line chart, which has X X axis and it is the #x question of Y axis.
Hours Questions 0 27 1 28 2 15 3 16 4 16 5 16 6 22 7 1 9 42 42 42 24 10 38 11 21 12 33 13 25 14 21 15 16 16 12 17 11 18 5 192 20 2 Thanks in the antecedents of your help. Kind regards
Jonathan
Like this:
In a table, data returned from query: full-time hourly website website irma hoc_client spreadsheet 2009-10-14 23:00:00 23 93 2 1 0 0 2009-10-15 00 : 00: 00 00 15 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4:00:00 0 4 91 5 1 0 0 0 0 0 0 0 0 0 0 05:00 05:00 05 23 9 13 1 0 0 0 0 0 0 0 0 0 06 06 06 063 443 14 14 0 0 0 0 0 0 0 0 0 07 07 07 07 568 23 11 0 0 0 0 0-10-15 08:00:00 08 613 37 59 0 0 0 0 0 0 9 0 9 9 9 9 8 834 30 60 0 0 0 0 0 0 0 10 10 10 10 10 10 10 1026 50 35 0 0 0 0 0 0 0 0 11 11:00 : 00 11 9 38 62 45 0 0 200 9 -201 12:00:00 12 794 72 58 0 0 200 9-10 13 13:00:00 13 708 71 39 0 2009-10-15 1 4:00:00 14 618 54 32 0 0 2009-10-15 15:00:00 15 336 64 14 0 0 9 -16 16:00:00 16 216 50 15 0 200 9 - 10-15 17 : 00:00 17 225 24 6 0 0 2009-10-15 18:00:00 18 148 20 5 0 90 9 -17 19 00:00 19 182 9 0 0 0 0 0 0 0 0 0 0 0 20:00:00 20 153 6 5 0 0 2009-10-15 21:00:00 21 102 2 1 0 0 2009-10-15 22:00:00 22 90 5 3 0 0 9 9-9 -1 15 23:00:00 23 56 3 3 0 Data similar to the call to the chart API: http://chart.apis.google.com/chart? Cht = BVS & amp; Amp; Chtt = DVO orders per hour & amp; Chbh = a, 1,3 & amp; Chs = 700x200 and chxt = x, y & amp; Chds = 0,2000 & amp; Chxr = 1,0,2000 & amp; Chco = FF0000000000000000 FF, FFFF 200BBFF, EEEEEEEEE00000000F5FF, 54FF 9F, CFF3FE, FFC 125 & Amp; Chdl = handheld | Website | IRMA | HOC Client | Spreadsheet and CXL = 0: | 23 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19. 20 | 21 | 22 | 23 and PhD = T: 93,15,61,25,39,91,239,443,568,613,834,102 6,938,794,708,618,336,216,225,148,182,153,102,90,56 2,1,0,2,0,5,13,14,23,37,30,50,62,72,71,54,64,50,24,20,9,6, 2,5,3 1,2,0,0,1,1,1,14,14,11,59,60,35,45,58,39,32,14,15,6,5,4,5, 1,3,3 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 / Code> This is a Barkart, they do something different for different chart types - but this is very literal. There are no "category calculations" done for you in Excel .
In Perl, I am creating strings to fill the loop and several GAPI chart values through the result values of the query.
Your data will be created in the string such as:
http://chart.apis.google.com/chart?cht?bvs&chtt=My Spiffy data & amp; Chs = 700x200 & amp; Chxt = x, y & amp; Chds = 0,40 & amp; Chxr = 1, 0, 40 & amp; Chco = FF0000 & amp; Chdl = Data & amp; Chxl = 0: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19. 20 | And CD = T: 27,28,15,16,16,16,22,19,42,24,38,21,33,25,21,16, 12,11,5,8,2
Comments
Post a Comment