davidib Posted June 5, 2008 Report Share Posted June 5, 2008 Hello, I'm using the listprovider to pass 7 data series to my chart. The code/app works fine, i.e. I see the data I expect to see in the charts/panes I expect them to be in. However sometimes I'll run the app, and for some reason the code exceptions out with an index out of range error. I've tracked this error down and discovered that sometimes the chart will show the series count as 0 (I.e. the Series property), even though the listprovider shows it has the 7 data series in it. Additionally, sometime the chart Series property will show a Count of 0, but when I drill down into the Series, it shows a count of 7. What is going on here? FWIW I've run the app only in the debugger. Also I am programatically building the data series and the listProvider, i.e. there is no datasource associated with the chart at design time Thanks for any help you can provide David Quote Link to comment Share on other sites More sharing options...
Frank Posted June 6, 2008 Report Share Posted June 6, 2008 Do you have a sample application that reproduces the problem? Quote Link to comment Share on other sites More sharing options...
davidib Posted June 6, 2008 Author Report Share Posted June 6, 2008 Hi Frank, yes I do. Can I send it to you? Thanks David Quote Link to comment Share on other sites More sharing options...
Frank Posted June 6, 2008 Report Share Posted June 6, 2008 You can either attach it here, or if privacy is a concern, you can e-mail it to our support department. Open a ticket and mention my name. Quote Link to comment Share on other sites More sharing options...
davidib Posted June 6, 2008 Author Report Share Posted June 6, 2008 Frank, thanks very much. I do have proprietary code in the project so I need to remove that code. FWIW the problem occurs before any of the proprietary code is touched, so removing this code shouldn't have an impact (I'll verify of course). So give me .5 hr and I'll send the project (VS 2005 project). In the meantime, here is a screen print of the problem in the debugger. As you can see in the screen print, 1.the ListProvider object has 7 series attached to it. (Each data series has only 1 element in it purposely). 2.And you can plainly see that the statement to attach the listProvider to the chart (chart1.DataSetting.DataSource = lstProvider. 3.I have a breakpoint right after the above statement executed. 4.Take a look in the lower left hand corner. I have the chart1.Series property displayed in the watch window. It shows a count of 0! Quote Link to comment Share on other sites More sharing options...
davidib Posted June 6, 2008 Author Report Share Posted June 6, 2008 Frank, attached is the project that is incurring the problem. Again the list provider has 7 data series in it, but after I attach the listProvider to the chart the code exceptions out at line 100 in the Form1.designer.cs code with an index out of range. (FWIW the same problem has happened in other projects as well). I've commented out any of my proprietary code and the problem still occurs. Thanks in advance for any help/insight you guys can provide David Quote Link to comment Share on other sites More sharing options...
davidib Posted June 6, 2008 Author Report Share Posted June 6, 2008 Frank, please let me know if you can take a look at this or should I just send it to support per you last reply Thanks David Quote Link to comment Share on other sites More sharing options...
davidib Posted June 10, 2008 Author Report Share Posted June 10, 2008 Hi Frank, can anyone help me with this issue? I've sent the issue to support, not sure what I can expect relative to if someone wil look at the issue and when. Any info/feedback would be appreciated David Quote Link to comment Share on other sites More sharing options...
Frank Posted June 10, 2008 Report Share Posted June 10, 2008 I was able to reproduce the problem in the sample program you sent. There is a bug in Chart FX that's causing this problem, specifically related to the ListProvider. The Series collection is not properly initialized. We will fix this in the next service pack, however, there is a easy workaround: Force the series collection initialization before passing the data to the chart as follows: object o = chart1.Series;Do this right before adding the DataSource. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.