Solved

Adding Large Numbers To Chart

Posted on 2013-05-10
4
349 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 34

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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

615 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