想做一个数据条形图
前台:
<chartingToolkit:Chart Background="White" Grid.ColumnSpan="3" BorderBrush="#A2A2A2" Grid.Row="4" Title="刀具寿命统计图" Margin="10,0,10,10">
<chartingToolkit:BarSeries Name="ChartSurplus" DependentValuePath="Value" IndependentValuePath="Key" ItemsSource="{Binding}" IsSelectionEnabled="True" Title="剩余寿命" Loaded="chartSurplus_Loaded"/>
<chartingToolkit:BarSeries Name="ChartRated" DependentValuePath="Value" IndependentValuePath="Key" ItemsSource="{Binding}" IsSelectionEnabled="True" Title="额定寿命"/>
</chartingToolkit:Chart>
后台:
Dictionary<string, int> BT = new Dictionary<string, int>();
Dictionary<string, int> BT1 = new Dictionary<string, int>();
for (var i = dt.Rows.Count - 1; i >= 0; i--)
{
BT.Add(dt.Rows[i]["刀具编号"].ToString(), Convert.ToInt32(dt.Rows[i]["剩余寿命"]));
BT1.Add(dt.Rows[i]["刀具编号"].ToString(), Convert.ToInt32(dt.Rows[i]["额定寿命"]));
}
运行效果如图:
如何能让横坐标的初始值为0?