daviddam Posted June 24, 2008 Report Share Posted June 24, 2008 I am trying to format the X axis for a chart. The data type coming from the DataTable is DateTime. I tried setting what I thought were the right properties to format the data, but I always get the full datetime displayed on the axis (e.g. "6/24/2008 14:45:00"). Below is a snippet: podChart.AxisX.Labels.Format = AxisFormat.Date;podChart.AxisX.Labels.CustomFormat = "MMM-yy";The documentation doesn't help since it actually refers to a LabelsFormat object which does not appear to exist any more. Is the CustomFormat property the right one to use? If so, is it working? If not, what should I do? Also, I have tried setting these properties both before and after setting the ItemsSource for the chart (because of another forum post I saw), but it didn't seem to matter where the code was positioned. Thank you, David Quote Link to comment Share on other sites More sharing options...
daviddam Posted June 25, 2008 Author Report Share Posted June 25, 2008 Not trying to be pushy, but I need to know if this is a problem with the control or something I am doing. I've been stuck on this problem for some time now. If someone could at least confirm whether this is a bug or not I would greatly appreciate it. I have a workaround I could implement, but I don't want to implement a workaround for something that doesn't require one. Thank you, David Quote Link to comment Share on other sites More sharing options...
JuanC Posted June 25, 2008 Report Share Posted June 25, 2008 We retried both setting the AxisX properties in XAML ... <cfx:Chart x:Name="chart1" Gallery="Line" ItemsSource="{Binding Source={StaticResource bidsData}}"> <cfx:Chart.Series> <cfx:SeriesAttributesCollection> <cfx:SeriesAttributes BindingPath="Value" BindingPathX="Date" /> </cfx:SeriesAttributesCollection> </cfx:Chart.Series> <cfx:Chart.AxisX> <cfx:Axis> <cfx:Axis.Labels> <cfx:AxisLabelAttributes Format="Date" CustomFormat="MMM-yy"/> </cfx:Axis.Labels> </cfx:Axis> </cfx:Chart.AxisX></cfx:Chart>As well as setting the AxisX properties in code chart1.AxisX.Labels.Format = AxisFormat.Date; chart1.AxisX.Labels.CustomFormat = "MMM-yy";Both tests worked as expected, can you check if you can duplicate this issues with our latest build? Can you create a small sample app with hardcoded data that reproduces the problem? Regards, JuanC 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.