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

Message ListMessage List     Post MessagePost Message

  Stacked Bar showing/hiding Question
Posted by Zaf on Mar-04-2004 09:02
Attachments:
I have what basically amounts to a stacked bar graph, and for the purpose of this example, the dataset is:

data0 = Array(100, 100, 100)
data1 = Array(0, 27, 27)
data2 = Array(0, 0, 14)

I'd like:

1. The first bar to show 100 (in blue)
2. The second bar ONLY to show the 27 and hide what would have been a blue stack underneath it.
3. The 3rd Bar only to show the 14 (in green) and to hide both the 27 and 100.

So my question is, can I individually hide some of the stacks depending on which bar I am on? If not what would you suggest?

Many Thanks,
Zaf
stack.jpg

  Re: Stacked Bar showing/hiding Question
Posted by Peter Kwan on Mar-04-2004 13:54
Attachments:
Hi Zaf,

Whereas it is possible to do it using multiple stacked bar layers, I think it is easier to simply use multiple box-whisker layers. Each color box is on a separate box-whisker layer so each box can be of different color.

First, transform your data into two arrays:

upperLimit = Array(100, 127, 141)
lowerLimit = Array(0, 100, 127)

Then draw one box-whisker layer for each box.

For i = 0 To UBound(upperLimit )
    ReDim tempData0(Ubound(upperLimit))
    ReDim tempData1(UBound(upperLimit))
    tempData0(i) = upperLimit(i)
    tempData1(i) = lowerLimit(i)
    Call c.addBoxWhiskerLayer(tempData0, tempData1, Array(), Array(), Array(), -1, cd.Transparent, cd.Transparent).setDataGap(0)
Next

I have attached a sample chart I made using the above code for your reference.

Regards
Peter Kwan
test.png

  Re: Stacked Bar showing/hiding Question
Posted by Zaf on Mar-04-2004 23:45
Excellent that worked well!

I have one last question, how do I add custom labels above each bar? I need to show the delta of each box-whisker, i.e. 100, 27 & 14 above each bar in the example.

I can't seem to get addCustomAggregateLabel to work.

Best,
Zaf

  Re: Stacked Bar showing/hiding Question
Posted by Zaf on Mar-05-2004 01:51
Never mind, I figured it out with addcustomdatalabel.

Thanks again,
Zaf