Solved

Adding Large Numbers To Chart

Posted on 2013-05-10
4
341 Views
Last Modified: 2013-05-19
I’m having some trouble adding large (8+ digit) numbers to the Y-axis of a chart at runtime. The Y-axis should display numbers (double data type) and the x-axis should display strings.
      When I add a number under 8 digits (using Points.AddXY, Points.AddY, or Points.Add) I get an error saying this:

A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll

Additional information: The added or subtracted value results in an un-representable DateTime.’
     There should be nothing date-related going on with the chart, only number values. This error occurs with and with decimals in the value I’m trying to add.
      The odd thing is that the error doesn’t occur when I can the Points.Add method, but when I call Chart.Update. I can add all the data fine, but when I call update, it gives me the above error.
      It seems like its treating the data as an OLE Automation Date, but I can’t imagine why. I set the Series. XValueType to String and Series. YValueType to Double at runtime for each series before adding the data.
      Any ideas?
0
Comment
Question by:BROOKLYN1950
  • 2
4 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 39160519
this error occurs when one of the types is datetime and it set to be its min/max values, either DateTime.MinValue or DateTime.MaxValue (default).
make sure u have no datetime type under any circumstance in your chart.
0
 
LVL 32

Expert Comment

by:sarabande
ID: 39160825
a first chance exception is not necessarily an error. it is a test on a variable which is controled by a try-catch block and where the exception was caught and handled by the software.

is there enough space at left of the y-axis to display a 8+ number? you also may consider that a floating point number rarely matches exactly to the number displayed but that there is mostly a rounding difference, for example the number 123456.78 might have the internal value 123456.7799998... where at the 14th or 15th decimal digit there is a significant difference. if the chart library uses float type the precision reduces to 6 or 7 digits. all that could lead to range errors if not configured rightly and the error message could be misleading in those cases.

Sara
0
 

Accepted Solution

by:
BROOKLYN1950 earned 0 total points
ID: 39166640
I figured out the problem. I had the intervaltype of the minorgridlines set to Minutes from when I was experimenting to try to solve this problem (which is still not solved). Setting it back to Auto or Number eliminated the error.
0
 

Author Closing Comment

by:BROOKLYN1950
ID: 39178305
I found the solution before anyone else had any idea what it was. It was a mistake on my end, I had done something wrong and not fixed it, then forgotten about it.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Wpf develop 5 32
Tabcontrol Caption? 1 24
C# Error - Add Failed 12 49
Installing IIS after Visual Studio 2015 Community Edition 5 17
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now