Guest User

Untitled

a guest
Oct 20th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. private async void CriaChart()
  2. {
  3. SfChart chart = new SfChart();
  4. DataService dataService = new DataService();
  5.  
  6. try
  7. {
  8. PieSeries pieSeries = new PieSeries()
  9. {
  10. ItemsSource = await dataService.GetDataGrid(IdOrcamento),
  11. XBindingPath = "TotalVenda",
  12. YBindingPath = "TotalLucro",
  13. ExplodeIndex = 1,
  14. ExplodeRadius = 10
  15. };
  16.  
  17. pieSeries.DataMarker = new ChartDataMarker();
  18. chart.Legend = new ChartLegend();
  19. chart.Title.Text = "GrΓ‘fico da Venda";
  20. pieSeries.Label = "TotalLucro";
  21. pieSeries.DataMarker.LabelContent = LabelContent.Percentage;
  22. chart.Series.Add(pieSeries);
  23.  
  24. this.Content = chart;
  25.  
  26. }
  27. catch(Exception ex)
  28. {
  29. string err = ex.Message;
  30. }
  31. }
  32.  
  33. {
  34. "IdOrcamento": 100030087,
  35. "TotalVenda": 1094,
  36. "TotalLucro": 273.71
  37. }
Add Comment
Please, Sign In to add comment