Map Chart
Map Chart
Hi
TeeChart Newbie here
I have a Map Chart on a window. I can hover over countries and they outline. I can click on a country and receive the OnClickSeries event. How do I change the colour of the country I clicked on?
Using TeeChart 2016
TIA
TeeChart Newbie here
I have a Map Chart on a window. I can hover over countries and they outline. I can click on a country and receive the OnClickSeries event. How do I change the colour of the country I clicked on?
Using TeeChart 2016
TIA
Re: Map Chart
Hello,
Here it is a simple example:
Here it is a simple example:
Code: Select all
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
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)
If SeriesIndex > -1 And ValueIndex > -1 Then
If TChart1.Series(SeriesIndex).PointColor(ValueIndex) = vbRed Then
TChart1.Series(SeriesIndex).PointColor(ValueIndex) = clTeeColor
Else
TChart1.Series(SeriesIndex).PointColor(ValueIndex) = vbRed
End If
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 |
Re: Map Chart
Hi Yeray
Thanks for this. I have got your suggestion working. One problem I have with Steema Help Documentation is finding out what the properties and methods are for the various things. For example, you wrote in our reply:
TChart1.Series(SeriesIndex).PointColor(ValueIndex) = vbRed
Where can I find out these properties like PointColor etc.? I have been looking through the help files but cant seem to find this ... ?
Thank you.
JP
Thanks for this. I have got your suggestion working. One problem I have with Steema Help Documentation is finding out what the properties and methods are for the various things. For example, you wrote in our reply:
TChart1.Series(SeriesIndex).PointColor(ValueIndex) = vbRed
Where can I find out these properties like PointColor etc.? I have been looking through the help files but cant seem to find this ... ?
Thank you.
JP
Re: Map Chart
Hello,
It's difficult to have an example of every property. However, we use to recommend looking at the Fetures Demo program shipped with the installation to see the majority of features in action.
There's also the documentation, with a list of all the properties and methods. Ie, you can find the PointColor property in the online documentation, going to the TeeChart Pro ActiveX Library Reference -> TeeChartx -> Series -> Properties -> Point Color.
It's difficult to have an example of every property. However, we use to recommend looking at the Fetures Demo program shipped with the installation to see the majority of features in action.
There's also the documentation, with a list of all the properties and methods. Ie, you can find the PointColor property in the online documentation, going to the TeeChart Pro ActiveX Library Reference -> TeeChartx -> Series -> Properties -> Point Color.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Map Chart
Hi Yeray
Thanks again. So how would I set the tooltip for a data point (i.e. a country) using a similar way as to PointColor()?
e.g. AX_TeeChartX.Series(ISeries).PointColor(ValueIndex) = RGB(255,123,32)
For example? Is it possible something similar for tooltip?
Thanks again. So how would I set the tooltip for a data point (i.e. a country) using a similar way as to PointColor()?
e.g. AX_TeeChartX.Series(ISeries).PointColor(ValueIndex) = RGB(255,123,32)
For example? Is it possible something similar for tooltip?
Re: Map Chart
See the example here:
http://www.teechart.net/support/viewtop ... 573#p73692
http://www.teechart.net/support/viewtop ... 573#p73692
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Map Chart
I'm sorry Yeray, but I dont see in the example how I set the text for any specific point (i.e. country) in the chart ? Sorry for being a newb ...
Re: Map Chart
Hello,
The OnMarkTipToolGetText is fired every time the MarkTip tool is going to be drawn. When it is fired, you have the ValueIndex of the point (MouseValueIndex), and the Text before being modified.
That should be enough information to modify the Text as you want.
The OnMarkTipToolGetText is fired every time the MarkTip tool is going to be drawn. When it is fired, you have the ValueIndex of the point (MouseValueIndex), and the Text before being modified.
That should be enough information to modify the Text as you want.
Code: Select all
Private Sub TChart1_OnMarkTipToolGetText(ByVal Tool As Long, Text As String)
If MouseValueIndex > -1 Then
Text = "Put the text you want for the ValueIndex: " + Str$(MouseValueIndex) + " here"
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 |
Re: Map Chart
Yeray
Thanks. So to add a MarkTip Tool to the chart I need to us something like: TChart1.Tools.Add tcMarksTip
What is the value of the constant tcMarksTip ? Where do I find these in the help?
Thanks
Thanks. So to add a MarkTip Tool to the chart I need to us something like: TChart1.Tools.Add tcMarksTip
What is the value of the constant tcMarksTip ? Where do I find these in the help?
Thanks
Re: Map Chart
Yeray
Almost have it
I have added a MarkTip tool to the chart
I have the call to OnMarkTipToolGetText() working and can set the tooltip text.
However, I do not know how to convert the OnMouseMouse() x and y values into a country ValueIndex ? I can receive the OnMouseMouse() function but it only gives me x and y parameters, not a ValueIndex. How to find the ValueIndex from the x and y values?
Thanks!
Almost have it
I have added a MarkTip tool to the chart
I have the call to OnMarkTipToolGetText() working and can set the tooltip text.
However, I do not know how to convert the OnMouseMouse() x and y values into a country ValueIndex ? I can receive the OnMouseMouse() function but it only gives me x and y parameters, not a ValueIndex. How to find the ValueIndex from the x and y values?
Thanks!
Re: Map Chart
Hello,
You can find the value for each constant at the TeeChartDefines.h, at the "Utilities\New VC Classes" folder in the TeeChart installation path.JPTP wrote:What is the value of the constant tcMarksTip ? Where do I find these in the help?
In the example here I used the series Clicked function to return the ValueIndex of the point at the given X, Y coordinates:JPTP wrote:However, I do not know how to convert the OnMouseMouse() x and y values into a country ValueIndex ? I can receive the OnMouseMouse() function but it only gives me x and y parameters, not a ValueIndex. How to find the ValueIndex from the x and y values?
Code: Select all
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
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Map Chart
Hi Yeray
Thanks I did not notice there was more code in the code window you provided - didn't see the scroll bar. I have it all working for now. Thanks very much.
Is there any place where one can see an exhaustive list of available functions that one can call?
Thanks!
Thanks I did not notice there was more code in the code window you provided - didn't see the scroll bar. I have it all working for now. Thanks very much.
Is there any place where one can see an exhaustive list of available functions that one can call?
Thanks!
Re: Map Chart
Hello,
- Online documentation including Tutorials and Library Reference. Documentation is also shipped with the installation for offline access.
- Compiled examples (with sources) shipped with the installation.
- IntellSense built-in the IDE of your choice to list properties or methods available for an object.
The options are:JPTP wrote: Is there any place where one can see an exhaustive list of available functions that one can call?
- Online documentation including Tutorials and Library Reference. Documentation is also shipped with the installation for offline access.
- Compiled examples (with sources) shipped with the installation.
- IntellSense built-in the IDE of your choice to list properties or methods available for an object.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Map Chart
Thanks Yeray. I have been looking through those CHM help files but find them hard to find things I am looking for. Your help is awesome though. Thanks.
Any suggestion regarding changing the colour of the country outline highlight colour when mouse over a country? Currently it is orange on my system but I prefer to change the colour if possible (and outline line thickness).
Thanks
Any suggestion regarding changing the colour of the country outline highlight colour when mouse over a country? Currently it is orange on my system but I prefer to change the colour if possible (and outline line thickness).
Thanks
Re: Map Chart
I'll reply you here.JPTP wrote:Any suggestion regarding changing the colour of the country outline highlight colour when mouse over a country? Currently it is orange on my system but I prefer to change the colour if possible (and outline line thickness).
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |