When using the CategoryDateTimeXAxis and setting the .MinimumValue/.MaximumValue the axis displays properly when there is data to be displayed. If a user tries to display a date range with no data setting the MinimumValue/MaximumValue does not seem to work. I get crazy Xaxis values like 01/01/0001, etc. Is there anyway to display proper Xaxis values even if there is no data to display in the chart?
Well, I took a look through CategoryDateTimeXAxis and it looks like the problem is in the InitializeActualMinimumAndMaximum method. The ActualMinimumValue and ActualMaximumValue are only set if the DateTimeColumn.Count > 0. Otherwise it uses DateTime.MinValue and DateTime.MaxValue which is the reason for the crazy XAxis values.
There's no hope of overriding that method since it's marked internal so the only way I've found to overcome the issue is to use a separate X Axis for display only (not attached to a series) and to add 2 dummy data points to it's DataSource that are updated every time the chart's date range is updated. The dummy data points are set to the Min/Max values for the chart.
This seems like it would be a common request for a chart so it seems weird that I'd have to use hack like this to get it to work. Am I missing something here? Same goes for graphing a LineSeries. It seems crazy that the XAxis doesn't support a differing number of data points per Series and that I have to create a unique XAxis for each and overlay them all to get it to work.
Hello,
I have logged this behavior with our developers in our tracking system, with an issue ID of 115598. I have also created a support ticket on your behalf with number CAS-94653-RZZ2XW in order to link the development issue to it so that you are automatically updated when a Service Release containing your fix is available for download.