Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.IO;
- using System.Windows.Forms.DataVisualization.Charting;
- namespace Диаграммы
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- Сhart1.Series.Clear();
- // Форматировать диаграмму
- Сhart1.BackColor = Color.Gray;
- Сhart1.BackSecondaryColor = Color.WhiteSmoke;
- Сhart1.BackGradientStyle = GradientStyle.DiagonalRight;
- Сhart1.BorderlineDashStyle = ChartDashStyle.Solid;
- Сhart1.BorderlineColor = Color.Gray;
- Сhart1.BorderSkin.SkinStyle = BorderSkinStyle.Emboss;
- // Форматировать область диаграммы
- Сhart1.ChartAreas[0].BackColor = Color.Wheat;
- // Добавить и форматировать заголовок
- Сhart1.Titles.Add("Диаграммы");
- Сhart1.Titles[1].Font = new Font("Utopia", 16);
- Сhart1.Series.Add(new Series("ColumnSeries")
- {
- ChartType = SeriesChartType.Pie
- });
- // Salary series data
- double[] yValues = { 2222, 2724, 2720, 3263, 2445 };
- string[] xValues = { "France", "Canada", "Germany", "USA", "Italy" };
- Сhart1.Series["ColumnSeries"].Points.DataBindXY(xValues, yValues);
- Сhart1.ChartAreas[0].Area3DStyle.Enable3D = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement