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 |