AiiDee AiiDee - 4 months ago 48
C# Question

How to disable labels and lines from pie chart?

actually I'm trying to remove the labels and the line which are leading to the labels. The app is in C# and I used OxyPlot to plot the piechart.

Here is my code. As you can see all what I've tried doesn't helped me.

Thanks for your help!

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;

Screenshot of the actually page


I solved this problem by myself. For everyone who need the same information for me these lines helped:

pieSeries.OutsideLabelFormat = "";
pieSeries.TickHorizontalLength = 0.00;
pieSeries.TickRadialLength = 0.00;