Solved

Adding Large Numbers To Chart

Posted on 2013-05-10
4
345 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 33

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

806 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