Jump to content
Software FX Community

No text annotations at the same height as user legend in chart


User (Legacy)

Recommended Posts

I'm handling a chart with a background image and some text annotations.

The text annotations are placed with fixed coordinates and all are showing up

nicely. If I'm adding a user legend to the chart, all annotations on the same

height of the user legend disapear.

My first thought was that the legend will cover the annotations, but I've tried

to set the width of the legend [1] and adjusting the background color to a

transparent one [2]. In neither of the cases the annotations will be shown. Only

after disabling the user legend with [3] all annotations are showing up.

Is there any sort of limitation, where annotations can be placed within a chart?

I've attached the chart with the user legend. Additionally to all the

annotations in the chart there are 2 more, just right of the legend within the

areas colored in red and green respectively.

Any ideas?

Thank you in advance,

Kurt

[1] chart.getUserLegendBoxObj().setWidth(100);

[2] chart.getUserLegendBoxObj().setBackColor(new Color(255,255,255,100));

[3] c.setUserLegendBox(false);

Link to comment
Share on other sites

Assuming your legend box is at the bottom of the chart, this is normal.

The legend box takes up a whole band of the chart, in other words, you can

not change the width of a legend box located at the bottom of the chart.

Annotation objects can only be in the chart area, they can not be on the

legend area. Since that whole band belongs to the legend, no annotation

objects can be drawn there.

--

Francisco Padron

www.chartfx.com

post-2107-13922364578425_thumb.jpg

Link to comment
Share on other sites

Thank you for your answer! You are right, my legend box is at the bottom of the 

chart [1] but I'm not completely clear about your answer.

Why is there a set of API methods allowing to change the width of the legend

like LegendBox.setAutoSize(boolean value) and LegendBox.setWidth(int value)?

Do I have to initialize the box in another way (e.g. undocked) to be able to

influence the width? Is there no way of allowing annotations at the same height

than the legend?

Regards, Kurt

[1] Chart.getUserLegendBoxObj().setDocked(Docked.BOTTOM);

on 03.05.2006 16:39 SoftwareFX Support stated:

> Assuming your legend box is at the bottom of the chart, this is normal.

>

> The legend box takes up a whole band of the chart, in other words, you can

> not change the width of a legend box located at the bottom of the chart.

>

> Annotation objects can only be in the chart area, they can not be on the

> legend area. Since that whole band belongs to the legend, no annotation

> objects can be drawn there.

>

Link to comment
Share on other sites

> Why is there a set of API methods allowing to change the width of the 

> legend like LegendBox.setAutoSize(boolean value) and

> LegendBox.setWidth(int value)?

When the legend box is docked right or left, the Width property can be set.

When the LegendBox is docked to the top or bottom the Height property can be

set.

> Is there no way of allowing annotations at the same height than the

> legend?

No, unless you don't have a legend at all and build one using annotation

objects. You may also consider using the PostPaint event instead of

annotation objects to draw on top of your chart. This will allow you to draw

anywhere.

--

Francisco Padron

www.chartfx.com

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...