I've tried to follow the examples about using OnSeriesClick and OnMouseMove with a Bubble chart to display bubble values, to no avail.
I can't even get the mouse events to react to the bubbles at all. The closest I've come is to get responses as I click or move the mouse along the X axis.
Is this a bug?
How can I point to and/or click on a bubble and have code respond to that?
I appear to be using: v7.0.1.4
Bubble Chart Click
-
- Newbie
- Posts: 21
- Joined: Tue Mar 01, 2005 5:00 am
- Location: Spokane, WA
- Contact:
Hi Productivity Guy,
For the OnClickSeries event this code works fine here after adding three Bubble series in achart:
And for the OnMouseMove event, you could try the following code after addingone bubble series in a chart:
For the OnClickSeries event this code works fine here after adding three Bubble series in achart:
Code: Select all
Private Sub Form_Load()
TChart1.Aspect.View3D = False
TChart1.Series(0).FillSampleValues 6
TChart1.Series(1).FillSampleValues 6
TChart1.Series(2).FillSampleValues 6
End Sub
Private Sub TChart1_OnClickSeries(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
TChart1.Repaint
With TChart1.Series(SeriesIndex)
Label1.Caption = "Clicked Series: " + .Name + " Point: " + Str$(ValueIndex) + " X: " + Str$(FormatNumber(.XValues.Value(ValueIndex), 2)) + " Y: " + Str$(FormatNumber(.YValues.Value(ValueIndex), 2))
End With
TChart1.Canvas.TextOut X, Y, "Clicked"
End Sub
Code: Select all
Private Sub Form_Load()
TChart1.Aspect.View3D = False
TChart1.Series(0).FillSampleValues 6
End Sub
Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
TChart1.Repaint
Index = TChart1.Series(0).Clicked(X, Y)
If Index <> -1 Then
Label1.Caption = "Value:" & TChart1.Series(0).asBubble.RadiusValues.Value(Index)
Else
Label1.Caption = "Move the mouse over a bubble"
End If
lastIndex = Index
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 21
- Joined: Tue Mar 01, 2005 5:00 am
- Location: Spokane, WA
- Contact:
Well, here's my problem. I can't even get a bubble to recognize the click.
Does not work when I click on a bubble. I DID find, however, that there are a few places in the X axis that register the click.
Here's the code I'm using to generate the chart (TChart0):
(The !LS, !LL are fields from the recordset passed as a parameter [prs] to the procedure.)
Can you see any reason I don't get the click event attached to a bubble?
Code: Select all
Private Sub TChart0_OnClickSeries(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long)
MsgBox "Clicked"
End Sub
Here's the code I'm using to generate the chart (TChart0):
Code: Select all
TChart0.Series(0).Clear
With prs
Do While Not .EOF
TChart0.Series(0).asBubble.AddBubble !LS, !LL * 100, 2.5, "TEST", RGB(0, 0, 255)
.MoveNext
Loop
End With
With TChart0
.Canvas.UseAntiAlias = True
.Series(0).asBubble.Pointer.Gradient.Visible = True
tmp = .Axis.Left.CalcXSizeValue(.Series(0).asBubble.RadiusValues.First)
.Axis.Bottom.MinimumOffset = tmp * (1 + 0.4)
tmp = .Axis.Left.CalcXSizeValue(.Series(0).asBubble.RadiusValues.Last)
.Axis.Bottom.MaximumOffset = tmp * (1 + 0.4)
tmp = .Axis.Left.CalcXSizeValue(.Series(0).asBubble.RadiusValues.First)
.Axis.Left.MinimumOffset = tmp * (1 + 0.4)
End With
Can you see any reason I don't get the click event attached to a bubble?
-
- Newbie
- Posts: 21
- Joined: Tue Mar 01, 2005 5:00 am
- Location: Spokane, WA
- Contact:
Hmmmm....
I created a brand new bubble chart on a brand new form, and YOUR sample code works. (I only tested the Click sample, so far.)
So, now I have to figure out what's different about MY chart that's keeping the click from working.
Do you notice anything?
Could it be that my Y axis values are all percents (i.e. all under 1)?
I created a brand new bubble chart on a brand new form, and YOUR sample code works. (I only tested the Click sample, so far.)
So, now I have to figure out what's different about MY chart that's keeping the click from working.
Do you notice anything?
Could it be that my Y axis values are all percents (i.e. all under 1)?
Hi Productivity Guy,
Could you try to do and send a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Could you try to do and send a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |