locked
How to set persantage values in LiveCharts ObservableValuse , C# WPF RRS feed

  • Question

  • Hello), Sorry for asking dumb questions but i've read a lot of forums and still haven't found any answer.

    In my WPF app i am using LiveChart library in order to display 2 section Doughnut Chart.

    The problem is that i can't understand how to properly set value to ObservableValue.

    For istance when i set  one PieSeries value  to 70 and another to 30 in my chart i get one section 72.73% another 27.27%

    When i set one PieSeries to value to 50 and another value to 50 in order to get 50% and 50%, instead i  get 25%, 75%    

    What i am doing wrong?  P.S. Unfortunately my account isn't varified yet so i am not allowed to atach images.

     SeriesCollection = new SeriesCollection
                {
                    new PieSeries
                    {
                        Title = "Total",
                        Values = new ChartValues<ObservableValue> { new ObservableValue(50) },
                        DataLabels = true
                    },
                    new PieSeries
                    {
                        Title = "Change",
                        Values = new ChartValues<ObservableValue> { new ObservableValue(50) },
                        DataLabels = true
                    },

                };

               DataContext = this;
                UpdateAllOnClick();

    • Moved by CoolDadTx Friday, November 6, 2020 4:00 PM Third Party Product
    Friday, November 6, 2020 3:53 PM

All replies

  • We only provide support for C#-specific questions in this forum. For questions related to third party products please post your question in their forums as they will have the expertise to assist you. For more general questions related to WPF please post in the new Microsoft Q&A forums.

    Michael Taylor http://www.michaeltaylorp3.net

    Friday, November 6, 2020 3:59 PM