10-25-2006 05:04 AM
10-25-2006 07:30 AM
I'm sorry to say that this functionality is not built into the CNiGraph. It is built into the .NET graphs, but if you are using MFC, you probably don't want to change your application to use the .NET graphs.
You will have to keep your own copy of the data that you pass to the CNiGraph. I would create a member varible of type CNiReal64Vector in the same class (probably a CDialog-derived class) that contains your instance of CNiGraph. Then, whenever you plot a point to the CNiGraph, call CNiReal64Vector::Append to add the data point to the vector.
10-26-2006 03:22 AM
I tried to do something like this:
m_Graph.GetCursors().Item("Cursor-1").SetPlot(m_Graph.GetPlots().Item("Plot-1"));
m_Graph.GetCursors().Item("Cursor-1").SetSnapMode(CNiCursor::SnapPointsOnPlot);
//inside a for loop - counter i
m_Graph.GetCursors().Item("Cursor-1").SetYPosition(CNiVariant(i));
x = m_Graph.GetCursors().Item("Cursor-1").GetXPosition();
but this option SnapPointsOnPlot doesn't do what I would like it to do.
I thought to set the Y Position for the Cursor - and increase it - and to read the X Position, while the cursor is somehow set to follow the plot - a snap option, but I couldn't find a proper snap mode
Do you know anything that can help?
Thanks,
Alexandra
10-26-2006 11:47 AM
Hey ale_m,
You need to read David's response above. You cannot obtain the data from the graph once it is plotted. You need to retain it while you are plotting.
Regards,
10-28-2006 11:42 AM