Menu

#38 .Refresh().method crashes - Still crashes

open
nobody
None
5
2009-12-17
2009-12-17
Anonymous
No

I would like to continue my latest thread, which was closed. It can be found with this link:
http://sourceforge.net/tracker/?func=detail&aid=2915404&group_id=161868&atid=821568

Thanks Jamcquay for your response, but your code didn't work. Have you any other suggestion how I shall solve this?

Here is my current code with your code response.

// Generate data samples each second
void runTimeLogger_Tick(object sender, EventArgs e)
{
xAxis.Add(counter++); // Generate a data sample to the X-axis
yAxis.Add((1.5 + Math.Sin((double)counter * 0.2))); // Generate a data sample to the Y-axis - This will create a sine-curve for the Y-axis
this.Invoke(new MethodInvoker(delegate() { UpdateGraph(); }));
}

// Update the display of the Nplot-graph
private void UpdateGraph()
{
Grid grid = new NPlot.Grid();
grid.VerticalGridType = Grid.GridType.Coarse;
grid.HorizontalGridType = Grid.GridType.Coarse;
grid.MajorGridPen = new Pen(Color.LightGray, 1.0f);

plotGraph.Add(grid);
StepPlot stepPlot = new StepPlot();
stepPlot.Pen = new Pen(Color.Red, 2);

stepPlot.AbscissaData = xAxis;
stepPlot.DataSource = yAxis;

plotGraph.Add(stepPlot);
plotGraph.Refresh(); // This row causes the program to crash!!! (Argument Out Of Range Exception)
}

Discussion

  • Jamie McQuay

    Jamie McQuay - 2009-12-17

    Try updating your NPlot.dll to the latest release (0.9.10.0). I noticed that your application is using the 0.9.9.2 build.

    I tried your application with the version that you have and it failed... once i updated to 0.9.10.0 the application worked.

    Post back here how you make out...

     
  • Nobody/Anonymous

    Please confirm if this fixed your problem

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.