我有以下 XAML:
<amq:SerialChart Grid.Column="0" Grid.Row="0" DataSource="{Binding Data}" CategoryValueMemberPath="Date"
AxisForeground="White"
PlotAreaBackground="Black"
GridStroke="DarkGray">
<amq:SerialChart.Graphs>
<amq:LineGraph ValueMemberPath="Downfall" Title="Downfall" Brush="Blue" />
</amq:SerialChart.Graphs>
</amq:SerialChart>
我的代码如下所示:
namespace DownfallControl
{
public partial class MainPage : PhoneApplicationPage
{
private ObservableCollection<DownfallLog> Data = new ObservableCollection<DownfallLog>()
{
new DownfallLog() { Date = new DateTime(2012, 2, 2), Downfall = 90.1 },
new DownfallLog() { Date = new DateTime(2012, 2, 3), Downfall = 89.6 },
new DownfallLog() { Date = new DateTime(2012, 2, 4), Downfall = 85.6 }
};
public MainPage()
{
InitializeComponent();
}
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
this.DataContext = this;
Data.Add(new DownfallLog() { Date = new DateTime(2012, 2, 6), Downfall = 85.6 });
}
}
public class DownfallLog
{
public double Downfall;
public DateTime Date;
}
}
任何线索为什么什么都没有出现?