Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Chart doesn't work. PieSeries doesn't create slice of profit

$
0
0

I need to show in my chart two value: Total and Profit. See the screeenshot of my chart:

273,71 is a profit. Total is 1094,00. This profit represents 25% of total. How can i do to show Total and profit? See below my chart using SfChart

 private async void CriaChart()
        {
            SfChart chart = new SfChart();
            DataService dataService = new DataService();

            try
            {
                PieSeries pieSeries = new PieSeries()
                {
                    ItemsSource = await dataService.GetDataGrid(IdOrcamento),
                    XBindingPath = "TotalLucro",
                    YBindingPath = "TotalVenda"
                };

                pieSeries.DataMarker = new ChartDataMarker();
                chart.Legend = new ChartLegend();
                chart.Title.Text = "Gráfico da Vendas";
                pieSeries.Label = "Lucro";
                pieSeries.DataMarker.LabelContent = LabelContent.Percentage;
                chart.Series.Add(pieSeries);

                this.Content = chart;

            }
            catch(Exception ex)
            {
                string err = ex.Message;
            }
        }

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>