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

Message ListMessage List     Post MessagePost Message

  Aggregate Label format and Multiple Bar Layer issue
Posted by Ram on Feb-15-2012 05:59
Attachments:
Peter

I have a bar chart.
2 sets of stacked bars (using addDataGroup() method) per x-label.

First-set of stack represents a Revenue value - using y-axis
Second-set of stack represents a Number value - using y-axis2

So far so good.

Since Both of the stacks are ON THE SAME LAYER, when I use the
setAggregateLabelFormat() method, both the stacks uses the same format.

In my scenario, my first stack bar should be formatted using $$ format, while the
second stack bar should be using the number format.

NOw...

To solve this problem, I tried to use MULTIPLE BAR LAYERS
The first stack uses BarLayer1
The Second stack users BarLayer2

Now I can use the AggregateLabelFormat in both of the layers (using different formats).
Now the Bar is displayed ok with the formats.

But I have one problem. The bars are OVERLAPPING (One behind the other).
Is there any way I can achieve the display so that the bars on the same x-location be
displayed side-by-side as if I am using only one bar layer?

Thanks for your help.
Screen shot 2012-02-14 at 1.58.22 PM.png

  Re: Aggregate Label format and Multiple Bar Layer issue
Posted by Peter Kwan on Feb-16-2012 00:42
Hi Ram,

You may add both sets of stacked bars in the same layer (using the addDataGroup method). For the labels, you may use Layer.addCustomGroupLabel to allow them to have different formats. For example, in Java:

for (int i = 0; i < myData.length; ++i) {
   layer.addCustomGroupLabel(0, i, "${value}", "Arial", 8, 0x000000);
   layer.addCustomGroupLabel(1, i, "{value}", "Arial", 8, 0x000000);
}

Hope this can help.

Regards
Peter Kwan