1

I'm contemplating using http://pchart.sourceforge.net/ for our graphing / charting requirements but another developer suggested the use of a javascript/jquery based one like - http://dojotoolkit.org/

While the look-n-feel for both are different, and perhaps a javascript based one is more easily manipulatable - I'm not convinced it would be the faster solution.

Wouldnt a PHP based toolkit be faster anyday, for the end user, with less data going back and forth between our server and the client machine?

Our charting requirements are for reporting purposes - we dont require users to manipulate the charts 'live' at all.

siliconpi
  • 8,105
  • 18
  • 69
  • 107

4 Answers4

0

I believe if the view is done at the client side it means less processing at the server. So i believe that client side graphing/charting would be better (using javascript)

sushil bharwani
  • 29,685
  • 30
  • 94
  • 128
0

with the requirement that you have stated the pHP one seems like a batter approach. Like you already mentioned if your chart is static and you are not sending over the data to the client side then it doesnt make sense to render the chart in js. Your php server will any day outperform the browser rendering speed as then your dependent on the client using the latest browsers in the market and they have adequate memory on client side to do the same.

Why is your teammate thinking of the JS approach. Does he have a reason for the same?

Baz1nga
  • 15,485
  • 3
  • 35
  • 61
0

I have recently found jqPlot and used it in a corporate project to my boss' delight. A PHP solution will not give you a solution as dynamic as a Javascript one. Moreover, PHP graph approach are sometimes bulky and require more code.

Once the Javascript code is downloaded unto the client's machine, it is cached for further requests, so only the graph's initialization code is downloaded (a few bytes + the series data), this results in fewer bytes being sent, thus a lower bandwidth consumption.

As for the report data, using caching mechanisms is probably the best solution as you can reuse the report data for different views (downloadable as CSV, etc.)

All and all, I personally usually prefer to keep the server side processing for data, and client side processing for the view representation.

Yanick Rochon
  • 51,409
  • 25
  • 133
  • 214
0

Without considering presentation aspects, the 2 approaches generally have their pros and cons, whereas one's pro being the other's con.

The PHP approach:

  • arguably more consistent results.
  • resulting chart(s) could be saved if data is constant once entered, this would avoid having the same process run multiple times, resulting better overall performance.

The Javascript approach:

  • less computing power needed on the server.
  • resulting chart(s) could be generated dynamically delivering a more interactive user experience.
shinkou
  • 5,138
  • 1
  • 22
  • 32