Menu

#30 DateTimeAxis throws unhandled exception due to WorldMax Bug.

0.9.10.0
open
nobody
General (25)
5
2009-03-06
2009-03-06
Anonymous
No

In the file attached, I am trying to create two linePlots and add them to a single Plotting Surface, based off NPlot's example code.
If the second LinePlot is not added to the plotting surface, everything works.

However, if the second line is added (using the same date range) the program crashed with a "ArguementOutOfRangeException: The added or subtracted value results in an un-representable DateTime.
Parameter name: months" on DateTimeAxis.cs line 587.

The real problem seems to be traced back to lines 326 and 327 of the file:
DateTime worldMinDate = new DateTime( (long)this.WorldMin );
DateTime worldMaxDate = new DateTime( (long)this.WorldMax );

The WorldMin seems to be 0, the "dawn of time", so to speak, and the WorldMax is some ungodly large number. (And I'm only trying to chart 50 days worth of data, and its larger than 50 days in ticks). That's as far as I've narrowed it so far. A breakpoint where the property is set might help narrow it done, and I'm going to try that next.

Thanks for all the great work you've done so far. Good Hunting.

Discussion

  • Nobody/Anonymous

    Visual Studio 2008 C# Web Handler using .NET 2.0

     
  • Nobody/Anonymous

    The email address for follow up on this ticket is redrobot AT gmail.com. Once again, thanks for all the great work you've done so far.

     
  • Nobody/Anonymous

    I've seen the same exception before. I was using a TradingDateTimeAxis for a CandlePlot but was setting the axis before adding the plot. This caused the WorldMin to remain zero causing the worldMinDate to be invalid. I worked around this problem by setting the CandlePlot data first, and then creating a new TradingDateTimeAxis initialized from the CandlePlot's SuggestXAxis() call before passing it into the graph. Then when I stepped through the NPlot source, WorldMin was no longer zero and the worldMinDate was correct.

     

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.