Page 1 of 1

How to change the shape of the series point

Posted: Mon Nov 13, 2006 3:56 am
by 9529132
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

Posted: Mon Nov 13, 2006 8:36 am
by narcis
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

Posted: Tue Nov 14, 2006 1:16 am
by 9529132
Thanks a lot!

David

Posted: Wed Nov 15, 2006 5:16 am
by 9529132
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

Posted: Wed Nov 15, 2006 9:38 am
by narcis
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?

Posted: Wed Nov 15, 2006 10:18 am
by 9529132
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

Posted: Fri Nov 17, 2006 5:03 am
by 9529132
Hi, any comment?

Posted: Tue Nov 21, 2006 5:24 am
by 9529132
Please, any news? Really need to solve this problem asap.

Posted: Tue Nov 21, 2006 10:45 am
by Pep
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.

Posted: Wed Nov 22, 2006 1:23 am
by 9529132
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

Posted: Wed Nov 22, 2006 9:08 am
by narcis
Hi David,

I've sent you a forums private message with the e-mail address where you can send the project.

Posted: Wed Nov 22, 2006 9:39 am
by 9529132
Hi, Narcís,

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

Thanks a lot.
David

Posted: Wed Nov 22, 2006 10:04 am
by narcis
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);
}

Posted: Thu Nov 23, 2006 12:59 am
by 9529132
Hi, Narcís,

Yeah, it works now. Thanks a lot!

David