ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  PHP - Use viewport without partial update
Posted by Carsten on Feb-20-2026 19:35
Hello,


I am currently evaluating ChartDirector for a PHP application and I’m very impressed with the functionality so far.

I have a PHP App. Now I wnat to implement a viewport control like shown in the
"Zooming and Scrolling with Viewport Control"  Example.

I have applied that flow to my code, and it works so far. The only thing is the partial update. I need to perform a costlty SQL query for that, even though my Data doesn't change. Since the complete data is added to the full chart at the bottom, can't  I just reuse that instead of performing a new SQL query ?


Regards
Carsten

  Re: PHP - Use viewport without partial update
Posted by Peter Kwan on Feb-21-2026 05:01
Hi Carsten,

To avoid SQL query for the same data, you may consider to cache the data on the server side. This can be as simple as using a PHP session variable to store the data. There are also several cache libraries for PHP.

If your web site is used by multiple users viewing the same data, they can use the same cached data, further reducing the data fetch. An example is a financial web site that shows stock data. Many users will be viewing the same stocks, so using cache will significantly reduce the SQL queries.

For the viewport control, even if your pass all the data to it, it may not use or keep all the data. It only use data sufficient to draw the chart. For example, if the chart is 800 pixels wide, it would only need at most 800 data points horizontally. This reduces the amount of data sent to the browser.

Should you need further information, please feel free to contact me.

Best Regards
Peter Kwan