|
3D Bar Charts |
Posted by Adrian Groves on Oct-26-2010 19:43 |
|
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
|
Re: 3D Bar Charts |
Posted by Adrian Groves on Oct-27-2010 17:12 |
|
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
|
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 |
|