|
Dynamic area |
Posted by Anders Soderberg on Feb-15-2011 04:45 |
|
hi
I just started with chartered director and have a problem with a backgrunds bar. three bars shows the outcome and behind them shows the target.
The goal must be dynamic.
I have a picture that shows how it look like, where I have added one. png background.
Is this possible to do.
Grateful for help
file not found: Namnl?st-1.gif | |
Re: Dynamic area |
Posted by Peter Kwan on Feb-15-2011 11:29 |
|
Hi Anders,
You may add two bar layers, one for the outcome, and one for the target. The target layer can be configued to stay behind the grid lines.
For example, in VB/VBScirpt:
Set layer = c.addBarLayer(targetData, ....)
Call layer.setBarGap(0.7)
Set layer2 = c.addBarLayer2(cd.Side)
Call layer2.addDataSet(outComeData, ....)
' dummy data set, just to fill up the right side, so that the outComeData bar is on the left side
Call layer2.addDataSet(Nothing)
Call c.getPlotArea().moveGridBefore(layer2)
Hope this can help.
Regards
Peter Kwan |
Re: Dynamic area |
Posted by Anders Soderberg on Feb-15-2011 15:53 |
|
Hello
Thanks for your help!
One more thing ..
Call layer2.setAggregateLabelFormat ("Target: {value}%")
Call layer2.setAggregateLabelStyle ("Arial.ttf", 10, & H000000, 90)
This text should be in the center of the bar (vertically). Now it's begins on the top ..
Anders |
Re: Dynamic area |
Posted by Peter Kwan on Feb-16-2011 10:24 |
|
Hi Anders,
The aggregate label is a label for the entire bar. It is put just outside the "far end" of the bar (which is the top of the bar if the bar is vertical and positive).
What you need is the data label, which is a label for a bar segment, and is put inside the bar segment.
(A single bar can contain multiple bar segments - such as in a stacked bar, percentage bar, overlay bar, etc. So we need two separate methods to label the entire bar, and to label individual bar segments.)
As you want to put the label on the left vertical center of the bar segment, the code should be:
Call layer2.setDataLabelFormat ("Target: {value}%")
Call layer2.setDataLabelStyle ("Arial.ttf", 10, & H000000, 90).setAlignment(cd.Left)
Hope this can help.
Regards
Peter Kwan |
|