UCTestPieCharts.cs
912 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using HZH_Controls.Controls;
namespace Test.UC
{
public partial class UCTestPieCharts : UserControl
{
public UCTestPieCharts()
{
InitializeComponent();
}
private void UCTestPieCharts_Load(object sender, EventArgs e)
{
Random r = new Random();
var pieItems = new PieItem[5];
for (int i = 0; i < 5; i++)
{
pieItems[i] = new PieItem
{
Name = "Source" + (i + 1),
Value = r.Next(10, 100)
};
}
this.ucPieChart1.SetDataSource(pieItems);
this.ucPieChart2.SetDataSource(pieItems);
}
}
}