实际上,我正在尝试删除标签和通向标签的线。该应用程序在C#中,我使用OxyPlot绘制了饼图。
这是我的代码。如您所见,我尝试过的所有内容都无济于事。
谢谢你的帮助!
public class MyViewModel
{
public PlotModel MyModel { get; set; }
public MyViewModel()
{
SingletonItem singletonItem = SingletonItem.Instance;
PieSeries pieSeries = new PieSeries();
pieSeries.Slices.Add(new PieSlice("Done", singletonItem.Done) {IsExploded = true, Fill = OxyColors.PaleVioletRed});
pieSeries.Slices.Add(new PieSlice("Undone", singletonItem.Undone) {IsExploded = true});
pieSeries.LabelField = "";
pieSeries.TickDistance = 0;
pieSeries.ValueField = "";
MyModel = new PlotModel();
MyModel.IsLegendVisible = false;
MyModel.Series.Add(pieSeries);
}
}
Screenshot of the actually page
最佳答案
我自己解决了这个问题。对于每个对我来说都需要相同信息的人,以下几行内容有所帮助:
pieSeries.OutsideLabelFormat = "";
pieSeries.TickHorizontalLength = 0.00;
pieSeries.TickRadialLength = 0.00;
关于c# - 如何禁用饼图中的标签和折线?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40609578/