Jump to content
Software FX Community

Problem with Annotation Type Rectangle


IT Support
 Share

Recommended Posts

Hello

The Annotation Rectangle is not drawn with the dimensions I programmed. When I draw a Rectangle at a certain XY-Pos with a Height = 1 and Width = 1 it is positioned correctly. But when I draw it with a Height of 136, the rectangle doesn't start at the same position as before!? The starting point is a bit lower, and the height doesn't seem to be what I programmed.

What could be the problem?

I'm using ChartFX Client Server 5.1 (5.0.10.3) with Active Report 2 (2.0.0.1176)

 regards

Luzia Baumgartner

Link to comment
Share on other sites

1) Make sure the annotation object is not attached to a logical coordinate (Attach method)

2) ActiveReports may be scaling the chart, which will in turn scale the annotation object. I suggest you try this outside of Active Reports to verify whether or not it is caused by this.

Link to comment
Share on other sites

Like I said: 

>ActiveReports may be scaling the chart, which will in turn scale the annotation object. I suggest you try this outside of

>Active Reports to verify whether or not it is caused by this.

If this is the case it is Active Reports who is doing the scaling, you have to ask them how.

Link to comment
Share on other sites

I solved the problem! I must not paint the annotation object in the loop of filling the bars. Now I paint it after the chart ist filled and the channel is closed with .CloseData.

Now I have another problem: the rectangle is positioned correctly, but not the bar itself! If you check the attached picture you can see that some bars are not exactly in the middle of the tick marks. How can I solve this problem? Do I have the possibility to get x-positions from left and right margin of each bar?

regards

Luzia Baumgartner

Link to comment
Share on other sites

There is a lot of pixel-perfect work done to make the bars look nice next to each other, with and without borders, etc. So it gets tricky.

Looking at your screenshot though, I think there is a much better way to achieve what you are looking for:

1) Instead of creating these annotation objects create 2 extra series (3 in total)

2) Assign the Gallery to Scatter to the third series

3) Assign chart.Cluster = true

4) Assign CHART_TRANSPARENT as the color of the second series and use IniValues to set the starting position.

I don't have the code for 5.1 (I don't have installed anymore) but I'm pretty sure it can be done like this.

Using this approach the bars will align perfectly.

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...