Avatar of TLN_CANADA
TLN_CANADA
Flag for Afghanistan asked on

Adding Chart to Web Page

We have a MYSQL/PHP database and want to add a chart to the web[age that shows the total amount of exercise per day over a period of time. Is there a nice chart plugin we could use for this?

The fields in the table are called exercise_id, exercise_time and exercise_timestamp.

Thanks for the help,

D
HTMLPHPJavaScript

Avatar of undefined
Last Comment
dimmergeek

8/22/2022 - Mon
IrogSinta

Ray Paseur

I've used JPGraph with very good success. http://jpgraph.net/
abolinhas

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
dimmergeek

Google charts is very easy to work with and produces customizable charts that blend seamlessly with your existing pages.
I pull data from SQL server, populate into an array and send the array to a Google API to produce this chart:
Screen shot of chart
TLN_CANADA

ASKER
Thanks everyone,

I'm looking to make a simple chart that shows a person's exercise practice over time. User's can track their exercise times in minutes in the database. I would like to setup a simple line chart that shows on the vertical axis the minutes they exercised and on the horizontal axis the month of the year. If the chart could automatically resize to the amount of user data in the database that would be ideal. (E.g. if they have only exercised for one month it would show each day in details whereas if they have a year's worth of data it would show the data in months on the horizontal access). Could anyone provide a simple example of this? I have tried to do this myself using 3 of the programs suggest above (Float Chart, Google Charts and PHPChart) but as I'm not a seasoned PHP developer I'm finding it difficult to set it up.

Thanks for your help,

D
TLN_CANADA

ASKER
If it helps, our database table is called exercise_table and the fields are:

exercise_id (ai)
exercise_duration (int in minutes)
exercise_timestamp
user_id
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
TLN_CANADA

ASKER
I can get all the necessary information from the database, I just can't figure out how to link it with the charts and the best chart system to use so that the view is automatically adjusted based on the amount of content for that user.
ASKER CERTIFIED SOLUTION
dimmergeek

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
TLN_CANADA

ASKER
Hi dimmergeek, we are using PHP/MYSQL. Will this work in the example you presented also?
dimmergeek

Yes, the data source does not matter.  Once you have your data, you just build an array table with it and then call the API.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
dimmergeek

Thanks for the points and good luck!