Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using System.IO;
  11. using System.Windows.Forms.DataVisualization.Charting;
  12.  
  13.  
  14. namespace Диаграммы
  15. {
  16. public partial class Form1 : Form
  17. {
  18. public Form1()
  19. {
  20. InitializeComponent();
  21. }
  22.  
  23. private void Form1_Load(object sender, EventArgs e)
  24. {
  25. Сhart1.Series.Clear();
  26. // Форматировать диаграмму
  27. Сhart1.BackColor = Color.Gray;
  28. Сhart1.BackSecondaryColor = Color.WhiteSmoke;
  29. Сhart1.BackGradientStyle = GradientStyle.DiagonalRight;
  30.  
  31. Сhart1.BorderlineDashStyle = ChartDashStyle.Solid;
  32. Сhart1.BorderlineColor = Color.Gray;
  33. Сhart1.BorderSkin.SkinStyle = BorderSkinStyle.Emboss;
  34.  
  35. // Форматировать область диаграммы
  36. Сhart1.ChartAreas[0].BackColor = Color.Wheat;
  37.  
  38. // Добавить и форматировать заголовок
  39. Сhart1.Titles.Add("Диаграммы");
  40. Сhart1.Titles[1].Font = new Font("Utopia", 16);
  41.  
  42. Сhart1.Series.Add(new Series("ColumnSeries")
  43. {
  44. ChartType = SeriesChartType.Pie
  45. });
  46.  
  47. // Salary series data
  48. double[] yValues = { 2222, 2724, 2720, 3263, 2445 };
  49. string[] xValues = { "France", "Canada", "Germany", "USA", "Italy" };
  50. Сhart1.Series["ColumnSeries"].Points.DataBindXY(xValues, yValues);
  51.  
  52. Сhart1.ChartAreas[0].Area3DStyle.Enable3D = true;
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement