Darin Daubert Posted August 25, 2009 Report Share Posted August 25, 2009 I've been getting an IndexOutOfRangeException on my graphs when I set the AxisX.Min and AxisX.Max when my axis format is a date format. I've attached a sample app recreating the issue I'm getting. The strange thing is that if you remove the WindowState=Maximized in XAML, I no longer get the error. Alternatively, I can also remove the AxisX.Min and AxisX.Max calls, and I no longer get the error. Unfortunately, in my project, I need to be able to set the Min and Max dates. Can you take a look at the example and let me know what I'm doing wrong? Thanks again!Darin Quote Link to comment Share on other sites More sharing options...
JuanC Posted August 26, 2009 Report Share Posted August 26, 2009 You have to do the following Move the BindingPathX from AllSeriesAttributes to the Series in the Chart.Series collection. We do not try to use any of the BindingPath* properties from AllSeries Remove the BindingPath from AxisLabelAttributes: You should not use this property when using XY charts. Remove the AxisX.AutoScale = false setting, this is not necessary as we will set it to false internally when you set Min and Max I would also recommend that to improve the formatting in your X axis you choose one of the following If you know your data will never include more than a day you can set Format="Time" and CustomFormat="hh:mm" If your data might include more than a day you might want to set Format="DateTime" (no CustomFormat required) JuanC Quote Link to comment Share on other sites More sharing options...
Darin Daubert Posted August 27, 2009 Author Report Share Posted August 27, 2009 You Rock!Thank-you very much!Darin 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.