+ // g2d.setClip(oldClip);
+
+ // Triangle
+ if (selected) {
+ at = g.getTransform();
+ g.translate( getWidth() - TRIANGLE_SIZE - 5, 0 );
+ g.setColor( color );
+ g.fill( TRIANGLE );
+ g.setTransform( at );
+ }
+ } else {
+ extra_width = 0.0;
+ double bounds_width = bounds.getWidth();
+
+ for(int label_index = 0; label_index < extra_labels.size(); label_index++) {
+ if(label_index >= singleAxisShowLegendsMaxLegends) {
+ break; // Maximum amount of labels that we should display has been reached
+ }
+
+ String label = extra_labels.get(label_index);
+ Color color = extra_label_colors.get(label_index);
+
+ double wid = fm.stringWidth(label);
+ double font_height = fm.getHeight();
+ extra_width += font_height;
+ //Letters are displayed in 90 degree angle, so font height is the width of the label as seen in X-direction
+
+ AffineTransform at = g.getTransform();
+ g.translate( bounds_width + label_index*font_height, (getHeight()-wid)/2);
+ // g2d.translate( 18+labelWidth, (getHeight()-wid)/2);
+ g.transform( AffineTransform.getQuadrantRotateInstance(1) );
+ g.setColor( color );
+ g.setFont( font );
+ g.drawString( label, (float) 0, (float) 0);
+ g.setTransform( at );
+ }