Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private async void CriaChart()
- {
- SfChart chart = new SfChart();
- DataService dataService = new DataService();
- try
- {
- PieSeries pieSeries = new PieSeries()
- {
- ItemsSource = await dataService.GetDataGrid(IdOrcamento),
- XBindingPath = "TotalVenda",
- YBindingPath = "TotalLucro",
- ExplodeIndex = 1,
- ExplodeRadius = 10
- };
- pieSeries.DataMarker = new ChartDataMarker();
- chart.Legend = new ChartLegend();
- chart.Title.Text = "GrΓ‘fico da Venda";
- pieSeries.Label = "TotalLucro";
- pieSeries.DataMarker.LabelContent = LabelContent.Percentage;
- chart.Series.Add(pieSeries);
- this.Content = chart;
- }
- catch(Exception ex)
- {
- string err = ex.Message;
- }
- }
- {
- "IdOrcamento": 100030087,
- "TotalVenda": 1094,
- "TotalLucro": 273.71
- }
Add Comment
Please, Sign In to add comment