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

Message ListMessage List     Post MessagePost Message

  XY chart
Posted by Mojibul on Aug-29-2009 23:36
Hi,

to plot graph we use XY chart object:    New XY(x values in pixel, y values in pixel).
Is it possible to give x and y values in percentage instead of pixel. Because to fit the plot in different screen size, i need to give this values as percentage.

Thanks and regards

Mojibul

  Re: XY chart
Posted by Peter Kwan on Sep-01-2009 00:32
Hi Mojibul,

If your application is a desktop application, your code should be able to know the size of the screen. Your code can then use this information to compute the chart size.

For example, if you want the chart width/height to be 50% that of the screen width/height, you can use (in VB/VBScript):

Set c = cd.XYChart(0.5 * screenWidth, 0.5 * screenHeight)

If your application is a web application, it is technically impossible for the server to know the screen size of the client machine, unless the client machine sends this information to the server. For example, you may have designed a web page that is sent to the client, detects the screen size, then sends this information to the server. In this case, your code already have the screenWidth and screenHeight, so you can use the above method to create the chart.

Hope this can help.

Regards
Peter Kwan

  Re: XY chart
Posted by Mojibul on Sep-08-2009 12:29
Hi,

How can i do this in php?

BR// Mojibul

  Re: XY chart
Posted by Peter Kwan on Sep-08-2009 23:25
Hi Mojibul,

The equivalent code in PHP is:

$c = new XYChart(0.5 * $screenWidth, 0.5 * $screenHeight);

As explained in my previous email, it is impossible for the server to know the screen size of the client machine, unless the client machine sends this information to the server. Therefore, before you run the above code, you must have sent another program to run on the client (that probably is a Javascript program embedded in a web page) to get the screen size, and send it back to the server, so that you can set up the $screenWidth and $screenHeight.

Hope this can help.

Regards
Peter Kwan