Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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;
        MyModel.Series.Add(pieSeries);
    }
}

Screenshot of the actually page

like image 769
AiiDee Avatar asked Dec 28 '25 07:12

AiiDee


1 Answers

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;
like image 96
AiiDee Avatar answered Dec 30 '25 19:12

AiiDee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!