Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 394563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:22:04+00:00 2026-05-12T16:22:04+00:00

Hi I have a query that I have run with MySql and I need

  • 0

Hi I have a query that I have run with MySql and I need to chart the data. I would be grateful if someone can tell me how I can format the output using php and feed it to Google in the right way and with the syntax – I have tried everything but no joy.

A code sample would be really useful if possible. Ideally I would like a line chart that has as its X axis the time and it’s Y axis the # of questions.

hour    questions
0   27
1   28
2   15
3   16
4   16
5   16
6   22
7   19
8   42
9   24
10  38
11  21
12  33
13  25
14  21
15  16
16  12
17  11
18  5
19  8
20  2

Thanks in anticpation of your help.

Kind regards

Jonathan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:22:05+00:00Added an answer on May 12, 2026 at 4:22 pm

    Like this:

    Data returned from the query, in a table:
    fulldate              hour       handheld   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
    2009-10-15 01:00:00   01         61         0         0         0          0
    2009-10-15 02:00:00   02         25         2         0         0          0
    2009-10-15 03:00:00   03         39         0         0         0          0
    2009-10-15 04:00:00   04         91         5         1         0          0
    2009-10-15 05:00:00   05         239        13        1         0          0
    2009-10-15 06:00:00   06         443        14        14        0          0
    2009-10-15 07:00:00   07         568        23        11        0          0
    2009-10-15 08:00:00   08         613        37        59        0          0
    2009-10-15 09:00:00   09         834        30        60        0          0
    2009-10-15 10:00:00   10         1026       50        35        0          0
    2009-10-15 11:00:00   11         938        62        45        0          0
    2009-10-15 12:00:00   12         794        72        58        0          0
    2009-10-15 13:00:00   13         708        71        39        0          0
    2009-10-15 14:00:00   14         618        54        32        0          0
    2009-10-15 15:00:00   15         336        64        14        0          0
    2009-10-15 16:00:00   16         216        50        15        0          0
    2009-10-15 17:00:00   17         225        24        6         0          0
    2009-10-15 18:00:00   18         148        20        5         0          0
    2009-10-15 19:00:00   19         182        9         4         0          0
    2009-10-15 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
    2009-10-15 23:00:00   23         56         3         3         0          0
    
    
    The same data as a call to the chart api:
    http://chart.apis.google.com/chart
    ?cht=bvs
    &chtt=DVO Orders Per Hour
    &chbh=a,1,3
    &chs=700x200
    &chxt=x,y
    &chds=0,2000
    &chxr=1,0,2000
    &chco=FF0000,00C000,0000FF,FFFF00,9B30FF,EE00EE,000000,00F5FF,54FF9F,C0FF3E,FFC125
    &chdl=Handheld|Website|IRMA|HOC Client|Spreadsheet
    &chxl=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
    &chd=t:93,15,61,25,39,91,239,443,568,613,834,1026,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,0,1,1,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
    

    That’s a barchart, they vary a bit for different chart types – but it’s very literal .. no “range calculations” done for you like in Excel.

    In Perl, I loop through the query result values and build strings to fill the various GAPI chart values.

    Your data would be built into a string like:

    http://chart.apis.google.com/chart
    ?cht=bvs
    &chtt=My Spiffy Data
    &chs=700x200
    &chxt=x,y
    &chds=0,40
    &chxr=1,0,40
    &chco=FF0000
    &chdl=Data
    &chxl=0:|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20
    &chd=t:27,28,15,16,16,16,22,19,42,24,38,21,33,25,21,16,12,11,5,8,2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a mysql table like that and i need to run a query
I am using in C# MYsql .I have query that works if I run
I have a java.sql.ResultSet object containg data from a query that was run. How
I have a MySQL table of correlation data that I need to extract. I
I have a MySql query that take a very long time to run (about
Have a script that I can copy and run in mysql shell just fine,
I have the next query that I run via SQLCMD.EXE use [AxDWH_Central_Reporting] GO EXEC
I have a basic query that I run over and over at each 2
I have the query below that when run it says that 325 rows were
I have a custom SQL query that I run with this line: @avg_score =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.