Hey,
I am having some serious problems trying to format the x-axis of the xamWebChart (using the version from 10.1) and changing the x-axis intervals. I don't want to see every date on the chart because there isn't enough space for it, so I want to see every fifth date or something. As well, my DateTimes are not formatted on the XAxis and all I see are the numbers 1 through 32.
My xaml is down there and there is nothing in the .xaml.cs file other than a m_graph.Refresh() when the DataSource for any of the series updates.
Any suggestions would be appreciated.
Thanks!
Normal 0 false false false EN-CA X-NONE X-NONE MicrosoftInternetExplorer4
<igChart:XamWebChart x:Name="m_graph" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5" Grid.Row="0" Visibility="{Binding CurrentTimeRange, Converter={StaticResource TimeRangeToVisibilityConverter}, ConverterParameter=Week}">
<igChart:XamWebChart.Legend>
<igChart:Legend Visibility="Collapsed" />
</igChart:XamWebChart.Legend>
<igChart:XamWebChart.Scene>
<igChart:Scene>
<igChart:Scene.GridArea>
<igChart:GridArea BorderThickness="0" Background="#00ffffff" />
</igChart:Scene.GridArea>
</igChart:Scene>
</igChart:XamWebChart.Scene>
<igChart:XamWebChart.Series>
<igChart:Series ChartType="Line" DataSource="{Binding DriverIdlingDisplayStats}"
DataMapping="Label=EventStartDate;Value=TotalIdleMinutes;ToolTip=IdlingToolTip"
Fill="{Binding Source={StaticResource m_red3DBrush}}" />
<igChart:Series ChartType="Line" DataSource="{Binding FleetIdlingDisplayStats}"
Fill="{Binding Source={StaticResource m_blue3DBrush}}" />
</igChart:XamWebChart.Series>
<igChart:XamWebChart.Axes>
<igChart:Axis Name="AxisX" AxisType="PrimaryX" Unit="5">
<igChart:Axis.Label>
<igChart:LabelGroup Format="{}{0:MMM-dd}"/>
</igChart:Axis.Label>
</igChart:Axis>
<igChart:Axis Name="AxisY" AxisType="PrimaryY" Stroke="#58FFFFFF" Visibility="Visible" StrokeThickness="0" AutoRange="True">
<igChart:LabelGroup Foreground="Black" FontFamily="Courier" />
<igChart:Axis.MajorGridline>
<igChart:GridlineGroup Visibility="Collapsed"/>
</igChart:Axis.MajorGridline>
<igChart:Axis.MinorGridline>
</igChart:Axis.MinorGridline>
<igChart:Axis.MajorTickMark>
<igChart:TickMarkGroup StrokeThickness="1"/>
</igChart:Axis.MajorTickMark>
</igChart:XamWebChart.Axes>
</igChart:XamWebChart>
Hi,
As of right now, you won't be able to set an interval on the axis when it comes to showing DateTime values. Also, you will have to continue with your work around with the EventDate property. It seems that what you're really looking for is the functionality of a DateTime axis. We are currently working towards including something like this in our upcoming 11. release.
Regards,
Marisa
There isn't actual data to give you because we directly query the database using the entity framework and then convert all the results into these EventIdlingDriverDisplayStat objects. The EventStartDate is always a date like 2010-10-18 12:00:00AM or something because we only want the date and the time portion is not useful.
The DataSource for the two series, DriverIdlingDisplayStats and FleetIdlingDisplayStats are just IEnumerable<EventIdlingDriverDisplayStat>. Where EventIdlingDriverDisplayStat is just a class full of properties. The EventDate property is my current work around to the unformatted dates however it still does not set the labels at a certain interval.
public class EventIdlingDriverFleetStat{
public string EventDate { get { return EventStartDate.ToString("MMM-dd"); } }
public DateTime EventStartDate { get; set; } public double AvgFleetActualFuelConsumed { get; set; } public double AvgFleetCalculatedFuelConsumed { get; set; } public int AvgFleetIdleTime { get; set; } public int FleetLongestSingleEvent { get; set; } public double AvgDriverActualFuelConsumed { get; set; } public double AvgDriverCalculatedFuelConsumed { get; set; } public int AvgDriverIdleTime { get; set; } public int DriverLongestSingleEvent { get; set; }
}
I hope this helps you. =/
Hi Reifujin,
I'm unable to reproduce your issue without the data you are using. Would it be possible for you to send me your data so I can further assist you?
Thanks,