dennis-fedco Posted September 16, 2014 Share Posted September 16, 2014 (edited) I have some data that I need to have visualized using 2D graphs. Looking around I see various tools available, in various technology flavors: JS: Google Charts, Flot, HighCharts PHP: phpCharts, pCharts, JpGraph Question I am trying to decide is -- do i want to use JS, or do I want to use PHP. Can someone please share some insight, provide some ideas, maybe shed some things I didn't think about, to help me consider choosing between these technologies? EDIT (thoughts): It seems and I think that JS technology is a bit more "polished" when it comes to graphing, and perhaps has a larger following, and perhaps is a bit more "dynamic" than similar packages done in PHP. On the PHP side, JpGraph is not being mantained but other packages are still in a reasonable condision I think. Is that enough to go with JS? Another area is that JS is client-side only really, so it may be hard to integrate it with anything server-side. aka, it's hard to "call back home" for data for example, so you have to establish all data upfront, when in PHP while on the server side, you can freely call Database as-you-go. Edited September 16, 2014 by dennis-fedco Quote Link to comment https://forums.phpfreaks.com/topic/291110-using-graphs-in-a-php-app/ Share on other sites More sharing options...
cyberRobot Posted September 17, 2014 Share Posted September 17, 2014 (edited) Another area is that JS is client-side only really, so it may be hard to integrate it with anything server-side. aka, it's hard to "call back home" for data for example, so you have to establish all data upfront, when in PHP while on the server side, you can freely call Database as-you-go. You could look into using Ajax to connect your JavaScript chart(s) to a database. For what it's worth, I currently use a JavaScript solution called amCharts. I don't have any great reasons for using the solution other than it was simple enough to figure out and it met my needs. I haven't spent that much time looking into the solutions mentioned, but phpCharts appears to create a JavaScript chart: http://phpchart.org/examples/line-bar-pie-charts/#prettyPhoto/0/ pChart seems interesting. The examples I've seen on their website are all images which look pretty good. Do you know if that's actual output or does pChart display the chart in some other fashion such as JavaScript? If pChart only produces images, one possible downfall of the solution is that you lose the interactivity that JavaScript solutions provide. Edited September 17, 2014 by cyberRobot Quote Link to comment https://forums.phpfreaks.com/topic/291110-using-graphs-in-a-php-app/#findComment-1491403 Share on other sites More sharing options...
Barand Posted September 18, 2014 Share Posted September 18, 2014 I usually produce my own "hand-rolled" charts. As production of a chart usually requires data from a DB server I produce them server-side using PHP, either as an image or using vector graphics. Producing them on the server with PHP does not preclude interaction with the user. If I require an interactive chart then I use SVG which allows me to assign mouse events to the various graphic elements (eg rectangles, circles). Of course you can make an image interactive with an image map but SVG makes it a lot easier. Quote Link to comment https://forums.phpfreaks.com/topic/291110-using-graphs-in-a-php-app/#findComment-1491531 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.