FastLine example

TeeChart for ActiveX, COM and ASP
roger
Newbie
Newbie
Posts: 26
Joined: Thu May 10, 2007 12:00 am

Re: FastLine example

Post by roger » Fri Oct 08, 2010 9:03 am

Hi,
Thanks a lot for that.
I have implemented it.
Now while drawing teechart the graph gets invisible very fast. Also it is showing error
canvas does not allow drawing
So how do I solve this problem??

Thanks,

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

Re: FastLine example

Post by Narcís » Fri Oct 08, 2010 9:13 am

Hi roger,

Can you please attach a simple example project we can run "as-is" and let us know the exact steps we should follow to reproduce the problem here?

Thanks in advance.
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

roger
Newbie
Newbie
Posts: 26
Joined: Thu May 10, 2007 12:00 am

Re: FastLine example

Post by roger » Fri Oct 08, 2010 9:31 am

Hi,
I am sorry but due to company policy I cannot do that.
Anyways thanks.

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

Re: FastLine example

Post by Narcís » Fri Oct 08, 2010 9:38 am

Hi roger,

We just need the simplest example project we can run "as-is" to reproduce the problem here. You can arrange a simple example project to illustrate the issue containing no code owned by your company.
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

roger
Newbie
Newbie
Posts: 26
Joined: Thu May 10, 2007 12:00 am

Re: FastLine example

Post by roger » Mon Oct 11, 2010 5:30 am

Hello,
I could not reproduce the error in demo code. Any ways i am giving you the code for initializing and plotting the graph.

I get a lot of trouble in viewing the graph, as the graph flickers a lot, The height of graph also increases and also the left axes dissapears frequently,

Code: Select all

void CManualTunningDialog::InitGraphs()
{
	for(int i = 0; i < MAX_MANUAL_TUNE_GRAPHS; ++i)
	{
		m_graph[i].GetHeader().SetVisible(FALSE);
		m_graph[i].AddSeries(GRAPH_LINE_TYPE);
			
		m_series[i] = m_graph[i].Series(0);
		m_axisLeft[i] = m_graph[i].GetAxis().GetLeft();
		m_axisTop[i] = m_graph[i].GetAxis().GetTop();
		m_axisBottom[i] = m_graph[i].GetAxis().GetBottom();
		m_axisRight[i] = m_graph[i].GetAxis().GetRight();
		m_canvas[i] = m_graph[i].GetCanvas();
		m_subtitle[i] = m_graph[i].GetSubHeader();

		m_graph[i].GetAxis().GetLeft().Scroll(1,FALSE);

		m_subtitle[i].SetAlignment(taLeftJustify);
		m_graph[i].GetAspect().SetView3D(FALSE);
		m_graph[i].GetZoom().SetEnable(FALSE);
		m_axisBottom[i].SetAutomatic(FALSE);

		int nMin = m_nAmu[i] - (m_nWidth[i] / 2);
		int nMax = m_nAmu[i] + (m_nWidth[i] / 2);
		AdjustMassWindow(nMin, nMax, m_nWidth[i]);
	
		m_axisBottom[i].SetMinMax(nMin, nMax );
		
		
		m_axisBottom[i].GetMinorGrid().SetVisible(FALSE);
		m_axisBottom[i].SetIncrement(1.0);
		m_axisLeft[i].GetMinorGrid().SetVisible(FALSE);
		m_axisLeft[i].GetLabels().SetValueFormat(_T("000.0"));
		m_axisLeft[i].GetLabels().SetSeparation(25);
		m_series[i].SetColor(SERIES_COLOR_BLUE);
		m_graph[i].GetLegend().SetVisible(FALSE);
		m_axisBottom[i].GetGridPen().SetVisible(false);
		m_axisLeft[i].GetGridPen().SetVisible(false);

		VARIANT vtLeftAxis;
		vtLeftAxis.vt = VT_I4;

		m_graph[i].GetTools().Add(tcAxisArrow);
		m_toolArrow[i] = m_graph[i].GetTools().GetItems(0);

		vtLeftAxis.lVal = m_axisLeft[i].GetAxisType();
		m_toolArrow[i].GetAsAxisArrow().SetAxis(vtLeftAxis);

		if (m_chkAutoScale.GetCheck() == BST_CHECKED)
		{
			// If Auto Scale is
			m_axisLeft[i].SetAutomatic(TRUE);
			m_toolArrow[i].SetActive(FALSE);

		}
		else
		{
			m_axisLeft[i].SetAutomatic(FALSE);
			if(m_dblLeftAxisMax[i] > 0)
				m_axisLeft[i].SetMinMax(0,m_dblLeftAxisMax[i]);
			else
				m_axisLeft[i].SetMinMax(0,DEFAULT_AXIS_MAX_YVALUE);

			m_toolArrow[i].SetActive(TRUE);
		}
	}
}

void PlotSpectrum()
{

	//Graph1
	int nTunTableCnt = 0;
	double dblMassIncr = (1.0 /(double)m_nNumPts);
	
	for(int nChartIndx = 0; nChartIndx < MAX_MANUAL_TUNE_GRAPHS; ++nChartIndx, ++nTunTableCnt)

	{
		m_series[nChartIndx].GetXValues().SetOrder(loNone);
		if (m_bDisplayGraph[nChartIndx] == true)
		{
	
			

			if(m_graph[nChartIndx].m_hWnd != NULL)
			{
				m_series[nChartIndx].SetActive(false);
				m_series[nChartIndx].Clear();
				
			}
			
			try
			{
				

			
				for (double dblCnt = nMin ; dblCnt < (nMax); ++nIntensityCnt, dblCnt += dblMassIncr)
				{
					
					dblMassVal = dblCnt;
					// converting Intensity in percentage, so highest intensity mapped to 100%
					dblIntensity = (vecdblIntensityValues[nIntensityCnt]);
				
					m_series[nChartIndx].AddXY(dblMassVal, dblIntensity, _T(""), SERIES_COLOR_BLUE);
		
					
				}
				Sleep(20);
				m_series[nChartIndx].SetActive(true);
				m_series[nChartIndx].RefreshSeries();
			
				
			}
			catch(...)
			{
				int n = 10;
			}
		}

}
Thanks in advace,

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: FastLine example

Post by Yeray » Thu Oct 14, 2010 11:13 am

Hi roger,

There are some methods and variables in the snipped of code you've posted that we don't know what they are doing (i.e. AdjustMassWindow).
For the rest, I don't see any special setting that may cause problems.

If you still have problems, please, try to arrange a simple example project we can run as-is to reproduce the problem here.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

roger
Newbie
Newbie
Posts: 26
Joined: Thu May 10, 2007 12:00 am

Re: FastLine example

Post by roger » Fri Oct 15, 2010 9:55 am

Hello,
Thanks for your response, the above problem was solved by adding m_graph[nChartIndx].RedrawWindow();
Now I am getting access voilation error.

Anyways can you please tell me the normal flow for painting as I read that graph.Repaint must be called after adding points to the series. So is there any protocol in which things should be carried out?

In my case i am doing things in following order:

series.clear()
series.addXY()
//m_series[nChartIndx].SetActive(true); (IS THIS NECESSARY)
//m_series[nChartIndx].RefreshSeries();(IS THIS NECESSARY)
m_graph[nChartIndx].RedrawWindow();
m_graph[nChartIndx].Repaint();
//m_graph[nChartIndx].UpdateWindow();(IS THIS NECESSARY)

Out of the above calls can you please tell me which of these are necessary and what is the difference in Redraw and Update window.

And what could be the optimized but correct (IDEAL) call sequence. Also why am I getting the access voilation error?

Error Message: Access Violation at address 504E6FE1in module TeeChart7.ocx . Read of address 00000004.

First-chance exception in KonikromPlus.exe (TEECHART7.OCX): 0xC0000005: Access Violation. It seems that I get this error when the teechart is put in background and I do some other work. Or open other window.

i read on other forums that it requires some QrTee.pas latest version . If it is so in my case could you please send it to me as well?


Thanks in advance,

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: FastLine example

Post by Yeray » Mon Oct 18, 2010 11:13 am

Hi Roger,

Please, see my reply here
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply