Here are my goals:
- Using the WPF Toolkit, create a simple column chart with a linear Y-axis and a DateTime range X-axis.
- Bind a collection of objects to the chart. Each object has a DateTime(X-axis data-point) and Int32(Y-axis data-point) properties.
Below is my current XAML. The XAML below has the axes I want however, the chart will not render any data:
<chartingToolkit:Chart Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" Name="ColumnChart" Title="Records Loaded By Date"
VerticalAlignment="Top" Height="262">
<chartingToolkit:Chart.Axes>
<chartingToolkit:DateTimeAxis Interval="1" IntervalType="Days" x:Name="myDateTimeAxis"
Orientation="X" Title="Date">
<chartingToolkit:DateTimeAxis.AxisLabelStyle>
<Style TargetType="chartingToolkit:DateTimeAxisLabel">
<Setter Property="StringFormat" Value="{}{0:MM/dd}"/>
</Style>
</chartingToolkit:DateTimeAxis.AxisLabelStyle>
</chartingToolkit:DateTimeAxis>
<chartingToolkit:LinearAxis Orientation="Y" ShowGridLines="True" x:Name="myYAxis"
Title="Transactions Loaded"/>
</chartingToolkit:Chart.Axes>
<chartingToolkit:Chart.Series>
<chartingToolkit:ColumnSeries DependentValuePath="TransactionLoadCount"
IndependentValuePath="Date" ItemsSource="{Binding Path=LoadStats}"
IsSelectionEnabled="True">
</chartingToolkit:ColumnSeries>
</chartingToolkit:Chart.Series>
</chartingToolkit:Chart>
Note: When I remove the XML section <chartingToolkit:Chart.Axes>...</chartingToolkit:Chart.Axes>
the data WILL APPEAR but not in a format I like.
Why doesn't the chart render my collection data?