|
Bar chart with side data combine method and goal lines |
Posted by Chris on Feb-29-2012 08:03 |
|
I have tried a few approaches to draw a bar chart with side grouping, but also with goal
lines using the BoxWhisker layer, and it seems the BoxWhisker layer doesn't support this
combine method. Are there any recommended ways to generate this chart? Currently I'm
drawing two separate bar layers, one being transparent with a red border as my goal lines,
but this affects mouseover tooltips and isn't ideal because there's no way to specify border
colors independently on each side (so as to only draw the border on the top of the bar).
Any ideas? |
Re: Bar chart with side data combine method and goal lines |
Posted by Peter Kwan on Feb-29-2012 22:40 |
|
Hi Chris,
You may use the Layer.alignLayer method to align the box-whisker layer to a data set of the bar layer. For example, in VB/VBScript, it is like:
'The box whisker layer for the first data aset
Set targetLayer0 = c.addBoxWhiskerLayer2(Nothing, Nothing, Nothing, Nothing, target0)
'Set the whisker width
Call targetLayer0.setDataWidth(c.getPlotArea().getWidth() / ((Ubound(target0) + 1) * 2) * 0.75)
'The box whisker layer for the second data aset
Set targetLayer1 = c.addBoxWhiskerLayer2(Nothing, Nothing, Nothing, Nothing, target1)
Call targetLayer1.setDataWidth(c.getPlotArea().getWidth() / ((Ubound(target1) + 1) * 2) * 0.75)
'The multibar layer
Set layer = c.addBarLayer2(cd.Side)
Call layer.addDataSet(data0, &Hff8080, "Server #1")
Call layer.addDataSet(data1, &H80ff80, "Server #2")
'Align the box-whisker layer to the data sets of the bar layer
Call targetLayer0.alignLayer(layer, 0)
Call targetLayer1.alignLayer(layer, 1)
Hope this can help.
Regards
Peter Kwan |
|