User (Legacy) Posted March 15, 2005 Report Posted March 15, 2005 I have created bubble charts and attached annotation text next to the center to show which bubble is which. The problem I am having is when a user zooms in on the a particular range of bubbles. When they do this, the annotation text gets moved further and further away from the bubble the more they zoom down. How do I get the annotation text to move proportionately with the bubble?
User (Legacy) Posted March 15, 2005 Author Report Posted March 15, 2005 I forgot to say that I am using Chartfx Client Server version 5.0. "Joe Glen" <jglen@quadramed.com> wrote in message news:mmdNnKZKFHA.1924@webserver3.softwarefx.com... > I have created bubble charts and attached annotation text next to the center > to show which bubble is which. The problem I am having is when a user zooms > in on the a particular range of bubbles. When they do this, the annotation > text gets moved further and further away from the bubble the more they zoom > down. How do I get the annotation text to move proportionately with the > bubble? > >
Software FX Posted March 20, 2005 Report Posted March 20, 2005 To what position did you attach the object ? If you offset the center position by a constant, this is the cause of the problem. The coordinates passed in Attach are "logical" coordinates, so any offset that you added is expressed in X and Y axis units. As you zoom into the chart, these units become bigger and the object ends up at the wrong position. If this is the case, this approach will not work. I would need to know more information about what you are trying to achieve in order to give you some alternatives. -- FP Software FX
User (Legacy) Posted March 21, 2005 Author Report Posted March 21, 2005 What I am trying to achieve is to allow the user to zoom in on a quadrant on the chart and when they do that, the labels that are attached to each bubble stays with that bubble. This way the user can still identify each bubble. What other information do you need from me in order to give me some alternatives? Joe "SoftwareFX Support" <noreply@softwarefx.com> wrote in message news:usa29FYLFHA.1660@webserver3.softwarefx.com... > To what position did you attach the object ? > > If you offset the center position by a constant, this is the cause of the > problem. The coordinates passed in Attach are "logical" coordinates, so any > offset that you added is expressed in X and Y axis units. As you zoom into > the chart, these units become bigger and the object ends up at the wrong > position. If this is the case, this approach will not work. > > I would need to know more information about what you are trying to achieve > in order to give you some alternatives. > > -- > FP > Software FX > >
Software FX Posted March 21, 2005 Report Posted March 21, 2005 What I meant was: Why are you using annotation objects in the first place. If it is solely for the purpose of labeling the points, there are better alternatives such as Custom Point labels. Custom painting is another option. Please attach a screenshot of the chart (before zooming). -- FP Software FX
User (Legacy) Posted March 22, 2005 Author Report Posted March 22, 2005 Here is an example of the graph before zooming takes place. If I were to zoom in on this, I would want the labels to stay with each bubble. Hope this gives you a better picture. I am open to doing this in other ways if you can show me how. Thanks. "SoftwareFX Support" <noreply@softwarefx.com> wrote in message news:M2g3lalLFHA.3800@webserver3.softwarefx.com... > What I meant was: Why are you using annotation objects in the first place. > If it is solely for the purpose of labeling the points, there are better > alternatives such as Custom Point labels. Custom painting is another option. > Please attach a screenshot of the chart (before zooming). > > -- > FP > Software FX > >
Software FX Posted March 22, 2005 Report Posted March 22, 2005 Ok. I see. The best way to achieve this would be using Custom Point labels. Custom Point Labels can be done by capturing the GetPointLabel event as follows: Private Sub ChartFX1_GetPointLabel(ByVal nSerie As Integer, ByVal nPoint As Long, nRes As Integer) ChartFX1.HText = "New Point Label" + Str(nSerie) + "," + Str(nPoint) ' Point label for this partiicular point and series. nRes = 1 ' Tells Chart FX that you have processed the event. End Sub Private Sub Form_Load() ChartFX1.Axis(AXIS_NUM_Y).Notify = True ' Enables Custom Point Labels ChartFX1.PointLabelAlign = LA_LEFT Or LA_BASELINE ' Alignment of Point Label text with respect to center of marker End Sub The GetPointLabel event is called during painting once for each point in the chart. -- FP Software FX
User (Legacy) Posted March 22, 2005 Author Report Posted March 22, 2005 This looks great so far. The one question I have is how to assign the proper text to each bubble. Each one is to display a different value, here is the code I have so far: rsPassedGraphdata.MoveFirst With frmReport.ChartFX1 ' code for marker labels For a = 0 To (.NSeries - 2) For b = 0 To (.NValues - 1) l_text = Trim(rsPassedGraphdata.Fields.Item(0).Value) ChartFX1.HText = l_text rsPassedGraphdata.MoveNext Next b Next a End With Thanks. "SoftwareFX Support" <noreply@softwarefx.com> wrote in message news:uqsso3uLFHA.3800@webserver3.softwarefx.com... > Ok. I see. > > The best way to achieve this would be using Custom Point labels. Custom > Point Labels can be done by capturing the GetPointLabel event as follows: > > > Private Sub ChartFX1_GetPointLabel(ByVal nSerie As Integer, ByVal nPoint As > Long, nRes As Integer) > ChartFX1.HText = "New Point Label" + Str(nSerie) + "," + Str(nPoint) ' > Point label for this partiicular point and series. > nRes = 1 ' Tells Chart FX that you have processed the event. > End Sub > > Private Sub Form_Load() > ChartFX1.Axis(AXIS_NUM_Y).Notify = True ' Enables Custom Point Labels > ChartFX1.PointLabelAlign = LA_LEFT Or LA_BASELINE ' Alignment of Point > Label text with respect to center of marker > End Sub > > The GetPointLabel event is called during painting once for each point in the > chart. > > -- > FP > Software FX > >
Software FX Posted March 22, 2005 Report Posted March 22, 2005 No. This is incorrect. You are not going to do a loop, Cart FX does the loop for you. All you have to do is to return the appropriate point label for each point from the GetPointLabel event. Check my code, unlike your code, my code does not have a loop and my code is inside the GetPointLabel event. You need to trap the GetPointLabel event and locate the label for that particular point (nPoint is passed to you). You can use your loop to fill out some arrays (that you will keep) and then return the contents of this array when you receive the calls to GetPointLabel. Notice that I said the calls, meaning you will get MANY calls to GetTip, one for each point. -- FP Software FX
User (Legacy) Posted March 23, 2005 Author Report Posted March 23, 2005 Thanks for the help. At first I was not sure how to get the proper label, but you gave me the idea on how to get it out of the recordset without looping through the recordset. Joe "SoftwareFX Support" <noreply@softwarefx.com> wrote in message news:1bj8IczLFHA.2580@webserver3.softwarefx.com... > No. This is incorrect. > > You are not going to do a loop, Cart FX does the loop for you. All you have > to do is to return the appropriate point label for each point from the > GetPointLabel event. > > Check my code, unlike your code, my code does not have a loop and my code is > inside the GetPointLabel event. You need to trap the GetPointLabel event and > locate the label for that particular point (nPoint is passed to you). > > You can use your loop to fill out some arrays (that you will keep) and then > return the contents of this array when you receive the calls to > GetPointLabel. Notice that I said the calls, meaning you will get MANY calls > to GetTip, one for each point. > > -- > FP > Software FX > >
Recommended Posts
Archived
This topic is now archived and is closed to further replies.