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

Message ListMessage List     Post MessagePost Message

  how to get the z-width
Posted by at on May-10-2012 11:46
Attachments:
Hi Peter, how can I get the width & height (depth) of the z axis so that I can calculate correctly where to place the
legend of the 3d bar graph attached? In my code I'm letting chartdirector decide its 3d depth by using -1.  Thanks.
fig_3-3d-bar.png

  Re: how to get the z-width
Posted by Peter Kwan on May-11-2012 00:21
Hi at,

You may consider to use XYChart.packPlotArea. This can be used to adjust the plot area size to fit the legend box. For example, you can just put the legend box at the right edge of the chart, and dynamically determine its width, and set the plot area to use the remaining width. See the sample code "Bars with Marks" for an example of using packPlotArea. (In that example, the legend box is put under the plot area, but you can adapt it to put it to the right of the plot area.)

Hope this can help.

Regards
Peter Kwan

  Re: how to get the z-width
Posted by at on Jan-25-2013 15:38
Attachments:
Hi Peter,
   Is there any way I could get the z-width here besides using the packPlotArea()
method since I got some other issue if I use it on the height (actually using it with the
width only)? What I'm trying to do now is to adjust they coordinate of the plot area so that
the title will not overlap over it so I basically need that since it varies depending on the
number of dataset.

  Pls see attached for reference. Thanks.
barhistogram.png
barhistogram.png

40.02 Kb

  Re: how to get the z-width
Posted by Peter Kwan on Jan-26-2013 01:05
Hi at,

You can specify the z-depth when you add the bar layer. For example, in the "Depth Bar Chart" sample code, the bar layer is added by the following code, which specifies the z-depth as 5 pixels.

$c->addBarLayer($data0, 0x808080ff, "Server # 1", 5);

If your code specifies the z-depth, then it knows the depth without having to ask ChartDirector.

Hope this can help.

Regards
Peter Kwan

  Re: how to get the z-width
Posted by at on Jan-30-2013 12:58
Hi Peter,
     I let CD to decide the depth by giving it -1 value. So if there's no way to get that value
then I will just have to manually set it myselft.

Thanks.

  Re: how to get the z-width
Posted by Peter Kwan on Jan-31-2013 00:14
Hi at,

Unluckily, there is no API available to obtain the automatic depth computed by ChartDirector. So I think setting it manually should be the most reliable method.

Regards
Peter Kwan