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

Message ListMessage List     Post MessagePost Message

  3D Bar Charts
Posted by Adrian Groves on Oct-26-2010 19:43
Attachments:
Please refer to attached image - can CD do this ? If so, is there an example that I can use to get started ?

The image needs to be shown isometrically (like attached), not just flat/shown from the front.

regards,

Ade
Bar6.png

  Re: 3D Bar Charts
Posted by Peter Kwan on Oct-27-2010 02:01
Hi Adrian,

Unluckily, ChartDirector cannot create a 3D bar chart with such view angle. The view angle of the ChartDirector 3D bar chart is fixed and not configurable. ChartDirector can only does 3D bart chart like the one in the sample code "Depth Bar Chart". There is a sample chart image in the ChartDirector gallery http://www.advsofteng.com/gallery_bar.html (second chart to the left side).

For your reference, the following forum thread shows a chart with the bars spaced further apart in the "depth" dimension:

http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&thread=1129738352#N1129746482

Regards
Peter Kwan

  Re: 3D Bar Charts
Posted by Adrian Groves on Oct-27-2010 17:12
Attachments:
Thanks for the quick reply Peter. As ever, you seem to always come up with a solution !

The attached picture is a quick mock up of my chart with the 3D effect as you proposed.
Notice how the top of the chart and the right are chopped off - Im presuming the chart size
does not cater for the fact that the 3D effect depth causes the chart to be taller & wider ?

Is there a way I can get around this so that the top/right of the chart is not chopped off ?

regards,

Ade
Bar6.png

  Re: 3D Bar Charts
Posted by Peter Kwan on Oct-28-2010 00:29
Hi Adrian,

Because the 3D depth of the layers are specified by your code, so your code knows the 3D depth of the layers and hence the total 3D depth. So to solve the problem, you may set the plot area size to compensate for the 3D depth. For example, suppose your plot area is set as:

$c->setPlotArea(100, 200, 1000, 2000);

you may change it to:

$c->setPlotArea(100, 200 + $total3DDepth, 1000 - $total3DDepth, 2000 - $total3DDepth);

Hope this can help.

Regards
Peter Kwan

  Re: 3D Bar Charts
Posted by Cherry on Jun-28-2012 11:35
Hi Peter,

I used your said solution, but the result can't accuracy when lots of bar in that report.
would you provide a flexible arithmetic to reslove this scenario ?

Thank,

Cherry

  Re: 3D Bar Charts
Posted by Peter Kwan on Jun-29-2012 03:35
Hi Cherry,

The code in my previous message should be accurate. For example, suppose you have 7 bar layers, and each layer has a 3D depth of 5 pixels (that is, you use $layer->set3D(5); to configure the bar layers), then the $total3DDepth should be 35 pixels, and the following code should work:

$c->setPlotArea(100, 200 + $total3DDepth, 1000 - $total3DDepth, 2000 - $total3DDepth);

If you think the above code is not working, would you mind to inform me of your charting code, especially the 3D depth you are using for the bar layers, and the $total3DDepth you are using. Is your $total3DDepth equals to the  (3D_depth * no_of_layers) in your code?

Regards
Peter Kwan