Hello
(Newbie here)
I have a map chart on a window. When the user hovers the mouse over a country how I can display a value associated with that country?
Thank you
Display a Country Value On Map Chart
Re: Display a Country Value On Map Chart
Hello,
You can use a MarksTip tool to show a tip when you move the mouse over the shapes/countries.
Then, you can use the OnMouseMove event to get the ValueIndex of the shape/country below the mouse and store it (ie MouseValueIndex).
And then you can use that index stores at OnMarkTipToolGetText to modify the Text string that will be shown.
Ie:
You can use a MarksTip tool to show a tip when you move the mouse over the shapes/countries.
Then, you can use the OnMouseMove event to get the ValueIndex of the shape/country below the mouse and store it (ie MouseValueIndex).
And then you can use that index stores at OnMarkTipToolGetText to modify the Text string that will be shown.
Ie:
Code: Select all
Dim MouseValueIndex As Integer
Private Sub Form_Load()
TChart1.Aspect.View3D = False
TChart1.Legend.Visible = False
TChart1.AddSeries scWorld
TChart1.Series(0).asWorld.Map = wmEurope
TChart1.Series(0).FillSampleValues
TChart1.Tools.Add tcMarksTip
End Sub
Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
MouseValueIndex = TChart1.Series(0).Clicked(X, Y)
End Sub
Private Sub TChart1_OnMarkTipToolGetText(ByVal Tool As Long, Text As String)
If MouseValueIndex > -1 Then
Text = TChart1.Series(0).PointLabel(MouseValueIndex) + " " + Str$(MouseValueIndex)
End If
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |