Lorre
var mapper = Mappers.Xy<MeasureModel>()
                .X(model => model.DateTime.Ticks)   //use DateTime.Ticks as X
                .Y(model => model.Value);           //use the value property as Y
            //lets save the mapper globally.
            Charting.For<MeasureModel>(mapper);
下面是设置cartesianChart1这个图标的样式
  cartesianChart1.Series = new SeriesCollection
            {
                new LineSeries
                {
                    Values = ChartValues, //设置值为ChartValues
                    PointGeometrySize = 18, //设置点的大小为18;
                    StrokeThickness = 4  //设置线宽
                }
            };
 
//添加一个值
  ChartValues.Add(new MeasureModel
            {
                DateTime = now,
                Value = R.Next(0, 10)
            });

相关文章: