Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 SPC Control Chart Tools for .Net
 Having single point in Mean_Range_Chart crashes
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

blazermaniac

USA
27 Posts

Posted - 21 Jul 2016 :  17:48:19  Show Profile  Reply with Quote
I found that if my chart has only a single point then the chart crashes with an 'Overflow error'.

I was able to reproduce this using the BatchVariableControlCharts sample BatchXBarRChart.

quinncurtis

1551 Posts

Posted - 22 Jul 2016 :  09:18:17  Show Profile  Reply with Quote
I would assume that you are calling the AutoCalculateControlLimits method, which according to the formulas for control limits require two or more sample intervals. In general you should assume that all charts require a minimum of two sample intervals before you try and plot them.
Go to Top of Page

blazermaniac

USA
27 Posts

Posted - 22 Jul 2016 :  11:32:08  Show Profile  Reply with Quote
I am not calling AutoCalculateControlLimits.

When tested with BatchVariableControlCharts - BatchXBarRCharts, the program got an exception in the Draw method of ChartView the 4th iteration of DrawObject(g2, achartobj, drect);

This is exactly where it happens with my program as well.
Go to Top of Page

quinncurtis

1551 Posts

Posted - 22 Jul 2016 :  13:14:54  Show Profile  Reply with Quote
I tested the BatchVariableControlCharts.BatchXBarRChart example, with one data point, in the current release, and cannot reproduce an error. So if it is critical in your application to display a chart with one data point (rather than waiting for two, since that is the only way control lines will be drawn), you should download the current version using your original download link(s).
Go to Top of Page

blazermaniac

USA
27 Posts

Posted - 22 Jul 2016 :  13:53:11  Show Profile  Reply with Quote
How I reproduced it in that example was to put a break point at the following line:

int numdatapointsinview = 17;

After executing that line I changed the value of numdatapointsinview to 1. Next I set a break point in SimulateData() and forced the loop to only execute once. Are these the same steps you used?
Go to Top of Page

quinncurtis

1551 Posts

Posted - 22 Jul 2016 :  13:58:55  Show Profile  Reply with Quote
You absolutely cannot have the numdatapointsinview parameter used to define the display characteristics of the chart set to 1. It must be set to the final number of sample intervals you expect you expect to display at a time for chart. It cannot be adjusted on the fly.
Go to Top of Page

blazermaniac

USA
27 Posts

Posted - 22 Jul 2016 :  14:55:54  Show Profile  Reply with Quote
In this particular exercise I did expect the final number of sample intervals to be 1 because I manipulated the logic in SimulateData() to only simulate data for a singe point.

However, you have solved my problem. I reran the test without adjusting numdatapointsinview and it didn't throw an exception. I took a closer look at the logic in my program and found the issue.

Normally I would set numdatapointsinview to a configured amount, however, if they are running a date range report I change numdatapointsinview to the number of rows returns from my query (If you're wondering, we do this in order to be able to capture a screen shot and save it to file). So in the case that only one row is returned from the query, setting numdatapointsinview to that value (1) causes the issue.

I will adjust my logic so that it never sets numdatapointsinview to less than 2.

Thanks for your help!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07