U++ framework
Do not panic. Ask here before giving up.

Home » Community » Newbie corner » How do I make this graph?
Re: How do I make this graph? [message #39902 is a reply to message #39894] Fri, 10 May 2013 06:48 Go to previous messageGo to previous message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Hello Koldo

This is the final piece of code that does exactly what I want it to do. Please let me know if you would do the same differently.

void	A2001_13::Plot()
{
	double f = -1;
	int 	cnt;

	// First, if the point is already in the vector, remove it
	// Then add the point to the vector and
	// Sort it.
	for (cnt=0; cnt < 	LeftSeries[0].GetCount(); cnt++)
	{
		if (LeftSeries[0].At(cnt).x == Test.spnFrequency.GetIndex())
				LeftSeries[0].Remove(cnt,1);
	}
	LeftSeries[0] << Pointf(Test.spnFrequency.GetIndex(),f*Test.spnIntensity);
	Sort(LeftSeries[0],SortPointf());
	Test.scaLeft.Refresh();
}


The max points in vector is 12. Any point changed, gets updated.

Best Regards
Jerson
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: MenuBar
Next Topic: SQL + vector related question
Goto Forum:
  


Current Time: Sat Apr 25 17:49:58 GMT+2 2026

Total time taken to generate the page: 0.01087 seconds