}
setMargin(cssLegendModel.getMargin(0), cssLegendModel.getMargin(1), cssLegendModel.getMargin(2), cssLegendModel.getMargin(3));
if (legend != null) {
LegendPosition position = legend.getPosition();
setPosition(position != null ? position.toRectangleEdge() : RectangleEdge.BOTTOM);
}
//from legend labels
ChartLabels labels = (legend != null) ? legend.getLabels() : null;
if (labels != null) {