How to change the shape of the series point

TeeChart for ActiveX, COM and ASP
Post Reply
David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

How to change the shape of the series point

Post by David » Mon Nov 13, 2006 3:56 am

Hi,

I would like to use different shapes for some series points.
(1) All the series points use the same shape like circle, square, etc.
(2) Some points use circle, and some use square, and the rest use default one.

In both of them, the connection line between two sequential points is still needed, not like the bubble points or point3D which have no connection line. How can I realize these functions?

Thanks a lot.
David

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Nov 13, 2006 8:36 am

Hi David,

Yes, you can do it using the OnGetSeriesPointerStyle event:

Code: Select all

Private Sub TChart1_OnGetSeriesPointerStyle(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, AStyle As TeeChart.EPointerStyle)
    If TChart1.Series(SeriesIndex).YValues.Value(ValueIndex) Mod 2 = 0 Then
        AStyle = psCircle
    Else
        AStyle = psRectangle
    End If
End Sub
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Post by David » Tue Nov 14, 2006 1:16 am

Thanks a lot!

David

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Post by David » Wed Nov 15, 2006 5:16 am

Hi,

I tried in VC++ and had no luck. Here is my code

void CDlgTester::OnGetSeriesPointerStyleTchart1(long SeriesIndex, long ValueIndex, long* AStyle)
{
*AStyle = psCross;
}

And all the points in the chart is still a dot. Any suggestion? BTW, I am using ActiveX ver7.0.0.8.

David

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Nov 15, 2006 9:38 am

Hi David,

It works fine for me here using v7.0.1.2. Have you added TeeChartDefines.h to your project so that the constants are properly defined?
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Post by David » Wed Nov 15, 2006 10:18 am

Hi, Narcís,

I just upgraded to 7.0.1.2 and it still didn't work. I have included the TeeChartDefines.h.

And there is one more problem. After I upgraded, the function CValueList::SetName is missing and there is a compiler error. I met the problem before when I upgraded from 7.0.0.8 and it turned out to be the TeeChart version slightly out of sync with the latest Library revision. http://www.teechart.net/support/viewtop ... c&start=15. Would you please help me check if there is still the problem? Otherwise, how come the CValueList::SetName is missing when it should be included?

Thank you very much!
David

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Post by David » Fri Nov 17, 2006 5:03 am

Hi, any comment?

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Post by David » Tue Nov 21, 2006 5:24 am

Please, any news? Really need to solve this problem asap.

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Nov 21, 2006 10:45 am

Hi David,

sorry for delay, using the latest v7.012 you should be able to accomplish it with the following code (here it's working fine) :

Code: Select all


void CChangePointerStylesDlg::OnOnGetSeriesPointerStyleTchart1(long SeriesIndex, long ValueIndex, long FAR* AStyle) 
{
if (ValueIndex > 2)
*AStyle=psCircle;
else
*AStyle=psRectangle;		
}
Would you please help me check if there is still the problem?
Yes, I've noticed that the header files still not sync in the latest maintenance, to update them please do the steps explained in the thread that you post here.

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Post by David » Wed Nov 22, 2006 1:23 am

Hi,Pep,

I tried again with the latest version and still got no luck. Since I can't visit the newsgroup, would you please give me you email address and I can send the demo project to you.

David

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Nov 22, 2006 9:08 am

Hi David,

I've sent you a forums private message with the e-mail address where you can send the project.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Post by David » Wed Nov 22, 2006 9:39 am

Hi, Narcís,

I have sent you the demo project in a zipped file.

Thanks a lot.
David

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Nov 22, 2006 10:04 am

Hi David,

Thanks for the project.

The problem is that the OnGetSeriesPointerStyle event is not fired because you are using FastLine series. FastLine series doesn't have Pointer property and therefore this event can't be fired.

For your project to work you should use Line series instead of FastLine series and set its pointer to visible. This code works:

Code: Select all

void CSeriesShapeDlg::Chart1Init()
{
	InitChartCommon(m_chart1);
	m_chart1.GetHeader().GetText().Clear();
	//m_chart1.AddSeries(scFastLine);	
	m_chart1.AddSeries(scLine);
	m_chart1.Series(0).GetAsLine().GetPointer().SetVisible(true);
}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Post by David » Thu Nov 23, 2006 12:59 am

Hi, Narcís,

Yeah, it works now. Thanks a lot!

David

Post Reply