无法在WPF中为基本OxyPlot列系列图表设置所有标签值

时间:2019-01-08 06:24:09

标签: wpf mvvm oxyplot

我放置了多个标签,但是在ColumnSeries图表中只能看到一个标签值。而且我已经在Separator下面尝试了Step = 1,但这仍然行不通。以下是我编写的代码。

                    SeriesCollection = new SeriesCollection();
                    Separator Separator = new Separator();

                    foreach (var item in QuesionnaireListdgv)
                    {
                        var per = item.Percentage.Replace("%", "");

                        SeriesCollection.Add(new ColumnSeries() { Values = new ChartValues<int> { 0 } });
                        SeriesCollection.Add(new ColumnSeries { Values = new ChartValues<int> { item.Attempt }, Fill = Brushes.Red, DataLabels = true });
                        SeriesCollection.Add(new ColumnSeries { Values = new ChartValues<int> { item.AttemptGreen }, Fill = Brushes.Green, DataLabels = true });
                        SeriesCollection.Add(new ColumnSeries { Values = new ChartValues<int> { Convert.ToInt16(per) }, Fill = Brushes.Orange, DataLabels = true });
                    }

                    Labels = new List<string>();


                    Labels = new List<string>()
                        {"T11", "T12", "T13", "T14", "T15", "T16", "T17", "T18", "T19", "T20", "T21"};
                    Separator = new Separator { Step = 1, IsEnabled = false };

下面是我的图表的图像: my Chart image

请告知我是否知道这个问题。

0 个答案:

没有答案