Page 1 of 1

Dragging a 2D Line Plot

Posted: Thu Mar 13, 2008 1:14 pm
by 15047739
After plotting a 2D line on a chart, is it possible to drag the 2d line in either horizontal or vertical direction for repositioning?

Posted: Thu Mar 13, 2008 3:18 pm
by narcis
Hi marathoner,

Is it a constant line? If so the best solution would be using a ColorLine tool. Otherwise you can do something like what's suggested here. This is a TeeChart for .NET example but the same should be available in the ActiveX version.

Hope this helps!

Posted: Thu Mar 13, 2008 6:35 pm
by 15047739
How do I choose the ColorLine tool?

Posted: Thu Mar 13, 2008 6:43 pm
by 15047739
The .NET example isn't at all clear. Can you give me an example in VC++ 6.0, that demonstrates how one drag a plot.

Posted: Fri Mar 14, 2008 8:53 am
by narcis
Hi marathoner,
How do I choose the ColorLine tool?
You can do this:

Code: Select all

	m_Chart1.GetTools().Add(tcColorLine);
	
	CAxis & axis = m_Chart1.GetAxis().GetLeft();
	VARIANT iAxis;    
	iAxis.vt = VT_DISPATCH;
	iAxis.pdispVal = axis;

	m_Chart1.GetTools().GetItems(0).GetAsColorLine().SetAxis(iAxis);
	m_Chart1.GetTools().GetItems(0).GetAsColorLine().SetValue(500);