1.
最终效果如下图:
1.1 准备数据 ViewModel
public class PrimaryItemModel
{
public double Value { get; set; }
public string XLabel { get; set; }
}
public class MainViewModel
{
public ObservableCollection<PrimaryItemModel> PrimaryList { get; set; }
public MainViewModel()
{
Random random = new Random();
PrimaryList = new ObservableCollection<PrimaryItemModel>();
for (int i = 0; i < 15; i++)
{
PrimaryList.Add(new PrimaryItemModel
{
XLabel = DateTime.Now.ToString("mm:s