IT Support 0 Posted March 27, 2007 Report Share Posted March 27, 2007 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 Quote Link to post Share on other sites
Frank 0 Posted March 27, 2007 Report Share Posted March 27, 2007 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. Quote Link to post Share on other sites
IT Support 0 Posted March 28, 2007 Author Report Share Posted March 28, 2007 I don't use an attach method, so I guess the attachstyle ATTACH_NONE is used by default, according to the manual. Do I have a chance to get the scaling factor somehow? regards Luzia Quote Link to post Share on other sites
Frank 0 Posted March 28, 2007 Report Share Posted March 28, 2007 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. Quote Link to post Share on other sites
IT Support 0 Posted March 29, 2007 Author Report Share Posted March 29, 2007 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 Quote Link to post Share on other sites
Frank 0 Posted March 29, 2007 Report Share Posted March 29, 2007 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. Quote Link to post Share on other sites
IT Support 0 Posted March 30, 2007 Author Report Share Posted March 30, 2007 GREAT!!!! That is exactly the right solution!! This is an old report with chartFX and was developed rather complicated. Now the code for filling and designing the chart is much easier. thank you very much Luzia Baumgartner Quote Link to post Share on other sites
Frank 0 Posted March 30, 2007 Report Share Posted March 30, 2007 Glad to hear that worked for you. Quote Link to post Share on other sites
Recommended Posts
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.