Pergunta

I am thinking of a standard AJAX setup (JS<->PHP<->MySql).

I want to generate reports (charts, tables, etc) probably using at maximum a few dozen data points (certainly never over 1k).

I am unsure whether to download all data on initial page load and generate charts when the user changes a parameter - say start date for example - using JS totally on the client side or to send an AJAX request to the server & use PHP there to generate & return a chart.

What should I take into consideration?

  • Is there a standard approach, or does it "depend"?
  • Any considerations of performance with so little data? Security?
  • Might client side be better if I want to export the reports?
  • Does it just boil down to which ever free charting package looks good to me?
  • For smart 'phones, can they readily generate charts responsively, or would it be better to download them as an image file form the server?
  • I suppose that it also depends on whether I will allow the user to click the charts & perform operations, or drag things around, etc. I.e. if I want something dynamic, or if a static image will suffice
Foi útil?

Solução

You are in the land of "depends"

I tend to favor client side reporting. However if it takes longer to transfer the data points then your in sever land.

There is no standard answer. For smaller data sets client side is fine and common.

No real performance concerns with small data sets other then off loading chart generation to the client (browser) means your can handle more requests.

Exporting the report depends on your needs, There are better server side solutions then client side ones for exporting reports, but why do they need to be exported. Can't they just be re-run.

It does depend on charting package, but go beyond just looking at the free ones. $200 is not that much in the grand scheme.

Modern mobiles can generate carts just fine, depends on the charting package.

Your much better using "dynamic" from the start. I have never seen a report that didn't make the user want to "drill down" somewhere.

Licenciado em: CC-BY-SA com atribuição
scroll top