php graphs

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

php graphs

Post by Vegan »

I was wondering what can PHP do for pie charts and other styles of various bar charts etc

what can I do with source data to mechanize updating the chart dynamically?

I am looking for open source ideally GNU or similar liberal license or if necessary, roll my own for open source
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: php graphs

Post by requinix »

Rolling your own is harder than it sounds. Uses a lot of math. Unless you want to do it for the fun of it, you should find a library.

PHP can do it fine - JpGraph is a good one. Javascript-based methods are also popular and offer an advantage that the user can interact with the chart.
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: php graphs

Post by Vegan »

I have strong math skills so that is not a big deal. Was straight A in high school and into university.

I noticed a few open source classes, not sure which one if any is what I can leverage, mind you i can always fork it and make a wordpress project out of it

https://hardcoregames.azurewebsites.net/?p=31712

This plugin is crude but it does work and it seems to be using the database? It uses a form in WP to add data and then colors for the pie parts can be added.

Plugin is free so no big deal. Seems to use JavaScript in page source to render the graph.
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: php graphs

Post by Vegan »

quarterly reports seem to be ok, but that seems to be as much as the first kick at the cat can do

seems that the database is stored in MySQL and then JS is used to render it, so the plug-in much be using some code generator and PHP Echo to conjure up the chart inline with the rest of the page
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Post Reply