getChart().add(PV.Label).data(visualItemsJsArray)
.left(baselineLabelStart).textAlign(PVAlignment.CENTER)
.bottom(new JsDoubleFunction() {
@Override
public double f(JsArgs args) {
PVMark _this = args.getThis();
// TODO dynamic positioning depending on label size
if (chartWidth / regularValues.length > 60) {
return -10;
}
return _this.index() % 2 == 0 ? -10 : -25;
}
}).text(new VisualItemStringSlotAccessor(BAR_LABEL))
.textBaseline(PVAlignment.MIDDLE);
}