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

Message ListMessage List     Post MessagePost Message

  Dual box whisker to one x-axis
Posted by Eva on May-31-2018 19:48
Is it possible to draw a plot like this?
Two boxwhiskerLayer and one barLayer to a x-axis.

https://imgur.com/a/ZcHG5h4

  Re: Dual box whisker to one x-axis
Posted by Peter Kwan on Jun-01-2018 02:01
Hi Eva,

Yes. To achieve your chart, you just need to shift the green Box-Whisker Layer to the left, and the blue Box-Whisker Layer to the right. This can be done with Layer.setXData.

For example, the code can be like:

' The bar layer with narrow bars
Set barLayer = c.addBarLayer(................)
Call barLayer.setBarGap(0.8)

' The green box whisker layer
Set greenLayer = c.addBoxWhiskerLayer(.........)
Call greenLayer.setXData(-0.25, UBound(boxTopData) - 0.25)
Call greenLayer.setDataGap(0.7)

' The blue box whisker layer
Set blueLayer = c.addBoxWhiskerLayer(.........)
Call blueLayer.setXData(0.25, UBound(boxTopData) + 0.25)
Call blueLayer.setDataGap(0.7)

' Set the x-axis labels and fix the scale
Call c.xAxis().setLinearScale(0, Ubound(labels), labels)

Hope this can help.

Regards
Peter Kwan