if (shapeLegend == null) {
return;
}
// calculate widths
TextBoundsEstimator estimator = new TextBoundsEstimator(FONT_FAMILY,
FONT_STYLE, FONT_WEIGHT, FONT_SIZE);
final Map<String, Integer> textWidths = estimator
.getWidths(shapeLegend.values());
int descriptionsWidth = 0;
for (Integer integer : textWidths.values()) {
descriptionsWidth += integer;
}
descriptionsWidth += textWidths.size()
* (SHAPE_SIZE + SHAPE_LEGEND_LABEL_SPACING);
int legendLabelWidth = estimator.getWidth(shapeLegendLabel);
int shapePanelWidth = legendLabelWidth > descriptionsWidth ? legendLabelWidth
: descriptionsWidth;
// panel for legend
PVPanel shapePanel = getChart()