Jump to content
Software FX Community

Recommended Posts

Posted

When adding an AnnotationText object with a colored border to a chart, I'm noticing that the text is anchored to the top-left portion of the border. Using the siteToFit() method does not fix this.

 I tried to change the alignment and the text still stays at the top of the bounding box.

 How do I add some padding around the text and the border?

http://energyiq.lbl.gov/images/annotationText.tiff

 

I have attached an image to this post, so hopefully it shows up. (http://energyiq.lbl.gov/images/annotationText.tiff)

Posted

Hi mcstoufer

Please contact Software FX Support at support[at]softwarefx[dot]com. Please provide us with the simplest form of the code (small compliable sample project) that reproduces the problem. Please remove the extra-code that is not related to Chart FX. Include your product serial number and/or support account in order to properly track your incidents.

Carlos Chaves

Posted

CJU70************Keep in mind that this is extracted from a JSF Managed Bean context, so the main() doesn't really exist. Also, this is being rendered on a Mac Pro running Snow Leopard OS X 10.6.4 with Java 1.6.Annotations annots = new Annotations();Font font = new Font("Helvetica", Font.PLAIN, 11);Color fontColor = Color.decode("0x464646");Color annotBubbleColor = Color.decode("0x9F4B9E");AnnotationArrow yourArrow = new AnnotationArrow();AnnotationText yourBldg = new AnnotationText();annots.getList().add(yourArrow);annots.getList().add(yourBldg);yourBldg.setFont(font);yourBldg.setTextColor(fontColor);yourBldg.setColor(java.awt.Color.WHITE);yourBldg.getBorder().setColor(annotBubbleColor);yourArrow.getBorder().setColor(annotBubbleColor);yourArrow.getBorder().setWidth(4);yourBldg.setText(String.format("Your Building:\n101 kW/h\n15th percentile"));yourBldg.setOrientation(0);yourBldg.setLineAlignment(StringAlignment.FAR);  // Tried the other two enum values here w/no apparent change.yourBldg.sizeToFit();yourBldg.attach(50, 50);yourArrow.setHeight(70);yourArrow.setWidth(0);yourArrow.attach(50,75);chart.getExtensions().add(annots);

Posted

Hi mcstoufer

 

I was unable to reproduce the issue, I changed the StringAlignment and it is working fine for me.  I recommend you to contact our support service by mail.  Please notice that the image you add to current forum is not visible, please include it to your mail.

 

Carlos Chaves

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...