如何从Livecharts中删除轴?
cartesianChart1.Series.Remove(object value)但是对象的值是什么呢?
这就是我添加这个系列的方法:
cartesianChart1.Series.Add(new LineSeries
{
Values = ValuesLinearity,
StrokeThickness = 2,
PointGeometrySize = 0,
DataLabels = false,
Title = "Linearity Error % new",
ScalesYAt = 1,
Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(0, 0, 0)),
Fill = System.Windows.Media.Brushes.Transparent,
LineSmoothness = 1,
});发布于 2019-11-08 10:43:40
SeriesCollection.Remove(SeriesCollection);
我遇到了同样的问题,这个解决方案对我很有效:
在我的MainWindow的构造函数中,我创建了一个序列集合,如下所示:
// Setup the chart
SeriesCollection = new SeriesCollection
{
new LineSeries
{
Title = "Series 1",
Values = new ChartValues<double> { 4, 6, 5, 2 }
},
new LineSeries
{
Title = "Series 2",
Values = new ChartValues<double> { 6, 7, 3, 4 }
}
};然后,我在一个按钮上使用了一个Click事件来运行这行代码:
SeriesCollection.Remove(SeriesCollection);
为了回答您的问题,“对象值”是变量的名称(在本例中为type ),包括要删除的序列集合中哪个序列的数组索引。
发布于 2018-11-13 17:41:44
cartesianChart1.Series.Clear();https://stackoverflow.com/questions/52850619
复制相似问题