Exception raised while getting Mark Coordinates...

TeeChart for ActiveX, COM and ASP
Post Reply
Thangaraj
Newbie
Newbie
Posts: 4
Joined: Mon Feb 09, 2004 5:00 am
Location: India

Exception raised while getting Mark Coordinates...

Post by Thangaraj » Fri Mar 26, 2004 2:08 pm

Hi there,

I am using Teechart Pro Ax v6,

I am trying to get marks coordinates and dimensions, for this I use the following in VC++


double x = m_TChart.Series(i).GetMarks().GetPositions().GetPosition(j).GetLeftTop().GetX();

This statement works fine for single series chart.

But for multi-series chart, except for value i=0;j=0; Teechart throws an exception for all values of i and j.

Kindly let me know what is wrong and how I can work around this....

Regards
Thangaraj A.L.
Thangaraj A.L.

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

Post by Pep » Sun Mar 28, 2004 10:59 pm

Hi Thangaraj,

using the following code (with the latest TeeChart Pro v6.04) works fine here, could you please test it ?

Code: Select all

void CGetXSeriesMarksDlg::OnButton1() 
{
	for (int i=0;i<=m_chart.GetSeriesCount()-1;++i)
		for (int j=0;j<=m_chart.Series(i).GetCount()-1;++j)
		{		
			int a =m_chart.Series(i).GetMarks().GetPositions().GetPosition(j).GetLeftTop().GetX();
			CString s;
			s.Format(_T("%d"), a);
			MessageBox(s);			
		}		
}

Thangaraj
Newbie
Newbie
Posts: 4
Joined: Mon Feb 09, 2004 5:00 am
Location: India

Post by Thangaraj » Mon Mar 29, 2004 8:40 am

Thanks Pep

The sample you gave showed me where I was going wrong. The problem was - I was using Tchart.Series(i).GetYValues().GetCount(), instead of TChart.Series().GetCount()

Thanks again....

Regards
Thangaraj A.L.

Post Reply