Commit d95b8fb9 HZH

移除部分内容

1 个父辈 e98ddec5
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 2019-09-17
//
// ***********************************************************************
// <copyright file="BarChartItem.cs">
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
// </copyright>
//
// Blog: https://www.cnblogs.com/bfyx
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
//
// If you use this code, please keep this note.
// ***********************************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class BarChartItem.
/// </summary>
public class BarChartItem
{
public BarChartItem()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="BarChartItem"/> class.
/// </summary>
/// <param name="_barBackColor">Color of the bar back.</param>
/// <param name="_itemName">Name of the item.</param>
/// <param name="_barPercentWidth">柱状图占平均宽度的百分比,默认0.8,即80%.</param>
public BarChartItem(
string _itemName = "",
Color? _barBackColor = null,
float _barPercentWidth = 0.9f)
{
barBackColor = _barBackColor;
itemName = _itemName;
barPercentWidth = _barPercentWidth;
}
/// <summary>
/// The bar back color
/// </summary>
private Color? barBackColor ;
/// <summary>
/// Gets or sets the color of the bar back.
/// </summary>
/// <value>The color of the bar back.</value>
public Color? BarBackColor
{
get { return barBackColor; }
set { barBackColor = value; }
}
/// <summary>
/// The bar percent width
/// </summary>
private float barPercentWidth = 0.9f;
/// <summary>
/// 获取或设置柱状图占平均宽度的百分比,默认0.9,即90%
/// </summary>
/// <value>The width of the bar percent.</value>
public float BarPercentWidth
{
get { return barPercentWidth; }
set { barPercentWidth = value; }
}
/// <summary>
/// The item name
/// </summary>
private string itemName;
/// <summary>
/// Gets or sets the name of the item.
/// </summary>
/// <value>The name of the item.</value>
public string ItemName
{
get { return itemName; }
set { itemName = value; }
}
}
}
using System.Drawing;
namespace HZH_Controls.Controls
{
public class CurveItem
{
public float[] Data = null;
public string[] MarkText = null;
public float LineThickness
{
get;
set;
}
public bool IsSmoothCurve
{
get;
set;
}
public Color LineColor
{
get;
set;
}
public bool IsLeftFrame
{
get;
set;
}
public bool Visible
{
get;
set;
}
public bool LineRenderVisiable
{
get;
set;
}
public RectangleF TitleRegion
{
get;
set;
}
private string renderFormat = "{0}";
public string RenderFormat
{
get { return renderFormat; }
set { renderFormat = value; }
}
public CurveItem()
{
LineThickness = 1f;
IsLeftFrame = true;
Visible = true;
LineRenderVisiable = true;
TitleRegion = new RectangleF(0f, 0f, 0f, 0f);
}
}
}
using System.Drawing;
namespace HZH_Controls.Controls
{
public class PieItem
{
public string Name
{
get;
set;
}
public int Value
{
get;
set;
}
/// <summary>
/// Gets or sets the color of the pie.如果为空则使用默认颜色
/// </summary>
/// <value>The color of the pie.</value>
public Color? PieColor
{
get;
set;
}
}
}
......@@ -54,11 +54,6 @@
<Compile Include="Colors\StatusColors.cs" />
<Compile Include="Controls\Charts\AuxiliaryLable.cs" />
<Compile Include="Controls\Charts\AuxiliaryLine.cs" />
<Compile Include="Controls\Charts\BarChart\BarChartItem.cs" />
<Compile Include="Controls\Charts\CurveChart\UCCurve.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\Charts\CurveChart\CurveItem.cs" />
<Compile Include="Controls\Charts\FunnelChart\FunelChartAlignment.cs" />
<Compile Include="Controls\Charts\FunnelChart\FunelChartDirection.cs" />
<Compile Include="Controls\Charts\FunnelChart\FunelChartItem.cs" />
......@@ -67,10 +62,6 @@
</Compile>
<Compile Include="Controls\Charts\MarkText.cs" />
<Compile Include="Controls\Charts\MarkTextPositionStyle.cs" />
<Compile Include="Controls\Charts\PieChart\UCPieChart.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\Charts\PieChart\PieItem.cs" />
<Compile Include="Controls\Charts\RadarChart\RadarLine.cs" />
<Compile Include="Controls\Charts\RadarChart\RadarPosition.cs" />
<Compile Include="Controls\Charts\RadarChart\UCRadarChart.cs">
......@@ -150,9 +141,6 @@
<DependentUpon>FrmLoading.cs</DependentUpon>
</Compile>
<Compile Include="Helpers\GraphDirection.cs" />
<Compile Include="Controls\Charts\BarChart\UCBarChart.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\Charts\ZoomType.cs" />
<Compile Include="Controls\FactoryControls\Arrow\UCArrow.cs">
<SubType>UserControl</SubType>
......
......@@ -76,9 +76,6 @@ namespace Test
TreeNode tnCharts = new TreeNode(" 图表");
tnCharts.Nodes.Add("组织结构图");
tnCharts.Nodes.Add("滚动图表");
tnCharts.Nodes.Add("柱状图");
tnCharts.Nodes.Add("饼状图");
tnCharts.Nodes.Add("曲线图");
tnCharts.Nodes.Add("雷达图");
tnCharts.Nodes.Add("金字塔图");
this.tvMenu.Nodes.Add(tnCharts);
......@@ -297,15 +294,6 @@ namespace Test
case "组织结构图":
AddControl(new UC.UCTestMindMapping() { Dock = DockStyle.Fill });
break;
case "柱状图":
AddControl(new UC.UCTestBarcharts());
break;
case "饼状图":
AddControl(new UC.UCTestPieCharts());
break;
case "曲线图":
AddControl(new UC.UCTestCurveChart());
break;
case "滚动图表":
AddControl(new UC.UCTestWaveChart() { Dock = DockStyle.Fill });
break;
......
......@@ -92,12 +92,6 @@
<Compile Include="UC\UCTestArrow.Designer.cs">
<DependentUpon>UCTestArrow.cs</DependentUpon>
</Compile>
<Compile Include="UC\UCTestBarcharts.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UC\UCTestBarcharts.Designer.cs">
<DependentUpon>UCTestBarcharts.cs</DependentUpon>
</Compile>
<Compile Include="UC\UCTestBlower.cs">
<SubType>UserControl</SubType>
</Compile>
......@@ -122,12 +116,6 @@
<Compile Include="UC\UCTestConveyor.Designer.cs">
<DependentUpon>UCTestConveyor.cs</DependentUpon>
</Compile>
<Compile Include="UC\UCTestCurveChart.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UC\UCTestCurveChart.Designer.cs">
<DependentUpon>UCTestCurveChart.cs</DependentUpon>
</Compile>
<Compile Include="UC\UCTestFunnelChart.cs">
<SubType>UserControl</SubType>
</Compile>
......@@ -254,12 +242,6 @@
<Compile Include="UC\UCTestPanelTitle.Designer.cs">
<DependentUpon>UCTestPanelTitle.cs</DependentUpon>
</Compile>
<Compile Include="UC\UCTestPieCharts.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UC\UCTestPieCharts.Designer.cs">
<DependentUpon>UCTestPieCharts.cs</DependentUpon>
</Compile>
<Compile Include="UC\UCTestProcess.cs">
<SubType>UserControl</SubType>
</Compile>
......@@ -416,9 +398,6 @@
<EmbeddedResource Include="UC\UCTestArrow.resx">
<DependentUpon>UCTestArrow.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UCTestBarcharts.resx">
<DependentUpon>UCTestBarcharts.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UCTestBlower.resx">
<DependentUpon>UCTestBlower.cs</DependentUpon>
</EmbeddedResource>
......@@ -434,9 +413,6 @@
<EmbeddedResource Include="UC\UCTestConveyor.resx">
<DependentUpon>UCTestConveyor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UCTestCurveChart.resx">
<DependentUpon>UCTestCurveChart.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UCTestForms.resx">
<DependentUpon>UCTestForms.cs</DependentUpon>
</EmbeddedResource>
......@@ -497,9 +473,6 @@
<EmbeddedResource Include="UC\UCTestPanelTitle.resx">
<DependentUpon>UCTestPanelTitle.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UCTestPieCharts.resx">
<DependentUpon>UCTestPieCharts.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UCTestProcess.resx">
<DependentUpon>UCTestProcess.cs</DependentUpon>
</EmbeddedResource>
......
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;
namespace Test.UC
{
[ToolboxItem(false)]
public partial class UCTestBarcharts : UserControl
{
public UCTestBarcharts()
{
InitializeComponent();
}
private Random random = new Random();
private void UCTestBarcharts_Load(object sender, EventArgs e)
{
this.ucBarChart1.SetDataSource(new double[] { random.Next(50, 100), random.Next(50, 100), random.Next(50, 100), random.Next(50, 100), random.Next(50, 100) });
this.ucBarChart2.SetDataSource(new double[] { random.Next(50, 100), random.Next(50, 100), random.Next(50, 100), random.Next(50, 100), random.Next(50, 100) }, new string[] { "张三", "李四", "王五", "赵六", "田七" });
this.ucBarChart3.SetDataSource(new double[] { random.Next(50, 100), random.Next(50, 100), random.Next(50, 100), random.Next(50, 100), random.Next(50, 100) }, new string[] { "张三", "李四", "王五", "赵六", "田七" });
this.ucBarChart4.SetDataSource(new double[] { random.Next(50, 100), random.Next(50, 100), random.Next(50, 100), random.Next(50, 100), random.Next(50, 100) }, new string[] { "张三", "李四", "王五", "赵六", "田七" });
this.ucBarChart4.AddAuxiliaryLine(60, Color.Red, "及格线超长占位符");
this.ucBarChart5.SetDataSource(new double[] { random.Next(50, 100), random.Next(50, 100), random.Next(50, 100), random.Next(50, 100), random.Next(50, 100) }, new string[] { "张三", "李四", "王五", "赵六", "田七" });
this.ucBarChart5.AddAuxiliaryLine(50, Color.Black, "及格线");
var ds = new double[5][];
for (int i = 0; i < ds.Length; i++)
{
ds[i] = new double[] { random.Next(50, 100), random.Next(50, 100), random.Next(50, 100) };
}
this.ucBarChart6.BarChartItems = new HZH_Controls.Controls.BarChartItem[] { new HZH_Controls.Controls.BarChartItem("语文"), new HZH_Controls.Controls.BarChartItem("英语"), new HZH_Controls.Controls.BarChartItem("数学") };
this.ucBarChart6.SetDataSource(ds, new string[] { "张三", "李四", "王五", "赵六", "田七" });
this.ucBarChart6.AddAuxiliaryLine(60, Color.Black);
var ds2 = new List<double[]>();
for (int i = 0; i < 20; i++)
{
ds2.Add(new double[] { random.Next(800, 2000), random.Next(100, 200) });
}
var titles = new List<string>();
double dblSum = ds2.Sum(p => p[0]);
for (int i = 0; i < ds2.Count; i++)
{
titles.Add("员工" + (i + 1) + "\n" + (ds2[i][0] / dblSum).ToString("0.0%"));
}
this.ucBarChart7.BarChartItems = new HZH_Controls.Controls.BarChartItem[] { new HZH_Controls.Controls.BarChartItem("合格"), new HZH_Controls.Controls.BarChartItem("次品") };
this.ucBarChart7.SetDataSource(ds2.ToArray(), titles.ToArray());
this.ucBarChart7.AddAuxiliaryLine(1000, Color.Black, "标准线");
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
namespace Test.UC
{
partial class UCTestCurveChart
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.ucCurve2 = new HZH_Controls.Controls.UCCurve();
this.ucCurve1 = new HZH_Controls.Controls.UCCurve();
this.ucCurve3 = new HZH_Controls.Controls.UCCurve();
this.SuspendLayout();
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 200;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// ucCurve2
//
this.ucCurve2.ColorDashLines = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(232)))), ((int)(((byte)(232)))));
this.ucCurve2.CurveNameWidth = 50;
this.ucCurve2.IntervalAbscissaText = 20;
this.ucCurve2.IsAbscissaStrech = true;
this.ucCurve2.IsRenderRightCoordinate = false;
this.ucCurve2.Location = new System.Drawing.Point(40, 327);
this.ucCurve2.Name = "ucCurve2";
this.ucCurve2.Size = new System.Drawing.Size(963, 318);
this.ucCurve2.StrechDataCountMax = 100;
this.ucCurve2.TabIndex = 1;
this.ucCurve2.Title = "动态数据";
//
// ucCurve1
//
this.ucCurve1.ColorDashLines = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(232)))), ((int)(((byte)(232)))));
this.ucCurve1.IntervalAbscissaText = -1;
this.ucCurve1.IsAbscissaStrech = true;
this.ucCurve1.Location = new System.Drawing.Point(40, 22);
this.ucCurve1.Name = "ucCurve1";
this.ucCurve1.Size = new System.Drawing.Size(963, 299);
this.ucCurve1.StrechDataCountMax = 7;
this.ucCurve1.TabIndex = 0;
this.ucCurve1.Title = "一周生产";
//
// ucCurve3
//
this.ucCurve3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(220)))), ((int)(((byte)(219)))));
this.ucCurve3.ColorDashLines = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucCurve3.ColorLinesAndText = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucCurve3.CurveNameWidth = 50;
this.ucCurve3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucCurve3.IntervalAbscissaText = -1;
this.ucCurve3.IsAbscissaStrech = true;
this.ucCurve3.IsRenderRightCoordinate = false;
this.ucCurve3.Location = new System.Drawing.Point(40, 651);
this.ucCurve3.Name = "ucCurve3";
this.ucCurve3.Size = new System.Drawing.Size(963, 534);
this.ucCurve3.StrechDataCountMax = 6;
this.ucCurve3.TabIndex = 1;
this.ucCurve3.Title = "小明模拟考试成绩走势";
this.ucCurve3.ValueSegment = 10;
//
// UCTestCurveChart
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.ucCurve3);
this.Controls.Add(this.ucCurve2);
this.Controls.Add(this.ucCurve1);
this.Name = "UCTestCurveChart";
this.Size = new System.Drawing.Size(1041, 1239);
this.Load += new System.EventHandler(this.UCTestCurveChart_Load);
this.ResumeLayout(false);
}
#endregion
private HZH_Controls.Controls.UCCurve ucCurve1;
private HZH_Controls.Controls.UCCurve ucCurve2;
private System.Windows.Forms.Timer timer1;
private HZH_Controls.Controls.UCCurve ucCurve3;
}
}
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;
namespace Test.UC
{
[ToolboxItem(false)]
public partial class UCTestCurveChart : UserControl
{
public UCTestCurveChart()
{
InitializeComponent();
}
private void UCTestCurveChart_Load(object sender, EventArgs e)
{
Random r = new Random();
this.ucCurve1.SetCurveText(new string[] { "周一", "周二", "周三", "周四", "周五", "周六", "周日" });
float[] data1 = new float[7];
float[] data2 = new float[7];
float[] data3 = new float[7];
for (int i = 0; i < data1.Length; i++)
{
data1[i] = r.Next(0, 100);
data2[i] = r.Next(0, 100);
data3[i] = r.Next(0, 100);
}
ucCurve1.SetLeftCurve("A", data1);
ucCurve1.SetLeftCurve("B", data2);
ucCurve1.SetLeftCurve("C", data3);
//辅助文字
ucCurve1.AddMarkText("A", 0, "周一数据", Color.Red);
ucCurve1.AddMarkText("A", 1, "周二数据");
ucCurve1.AddMarkText("B", 0, "周一数据");
ucCurve1.AddMarkText("B", 1, "周二数据");
ucCurve1.AddAuxiliaryLabel(new HZH_Controls.Controls.AuxiliaryLable()
{
LocationX = 0.8f,
Text = "不合格数:5",
TextBack = Brushes.Red,
TextBrush = Brushes.White
});
ucCurve1.AddLeftAuxiliary(20, Color.Red);
ucCurve2.SetLeftCurve("A", null, Color.Red);
ucCurve2.SetLeftCurve("B", null, Color.Orange);
ucCurve2.SetLeftCurve("C", null, Color.Blue);
ucCurve2.SetLeftCurve("D", null, Color.Green);
this.ucCurve3.SetCurveText(new string[] { "第一次模拟", "第二次模拟", "第三次模拟", "第四次模拟", "第五次模拟", "第六次模拟", "第七次模拟" });
float[] data31 = new float[6];
float[] data32 = new float[6];
float[] data33 = new float[6];
float[] data34 = new float[6];
float[] data35 = new float[6];
float[] data36 = new float[6];
for (int i = 0; i < data31.Length; i++)
{
data31[i] = r.Next(10 + i * 10, 40+i*10);
data32[i] = r.Next(10 + i * 10, 40+i*10);
data33[i] = r.Next(10 + i * 10, 40+i*10);
data34[i] = r.Next(10 + i * 10, 40+i*10);
data35[i] = r.Next(10 + i * 10, 40+i*10);
data36[i] = r.Next(10 + i * 10, 40+i*10);
}
ucCurve3.SetLeftCurve("语文", data31);
ucCurve3.SetLeftCurve("数学", data32);
ucCurve3.SetLeftCurve("英语", data33);
ucCurve3.SetLeftCurve("化学", data34);
ucCurve3.SetLeftCurve("生物", data35);
ucCurve3.SetLeftCurve("物理", data36);
for (int i = 0; i < data31.Length; i++)
{
ucCurve3.AddMarkText("语文", i, data31[i].ToString());
ucCurve3.AddMarkText("数学", i, data32[i].ToString());
ucCurve3.AddMarkText("英语", i, data33[i].ToString());
ucCurve3.AddMarkText("化学", i, data34[i].ToString());
ucCurve3.AddMarkText("生物", i, data35[i].ToString());
ucCurve3.AddMarkText("物理", i, data36[i].ToString());
}
}
int count_tick = 0;
private void timer1_Tick(object sender, EventArgs e)
{
count_tick++;
float random1 = (float)(Math.Sin(2 * Math.PI * count_tick / 30) * 0.5d + 0.5);
float random2 = (float)(Math.Sin(2 * Math.PI * count_tick / 50) * 0.5d + 0.5);
float random3 = (float)(Math.Cos(2 * Math.PI * count_tick / 80) * 0.5d + 0.5);
float random4 = (float)(Math.Cos(2 * Math.PI * count_tick / 10) * 0.5d + 0.5);
if (count_tick % 50 == 0)
{
ucCurve2.AddCurveData(
new string[] { "A", "B", "C", "D" },
new float[]
{
random1*10 + 80,
random2*20+50,
random3*20+30,
random4*10+20,
}, new string[] { "标签1", "标签2", "标签3", "标签4" }
);
}
else
{
ucCurve2.AddCurveData(
new string[] { "A", "B", "C", "D" },
new float[]
{
random1*10 + 80,
random2*20+50,
random3*20+30,
random4*10+20,
}
);
}
if (count_tick > 10000)
count_tick = 0;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
namespace Test.UC
{
partial class UCTestPieCharts
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
HZH_Controls.Controls.PieItem pieItem1 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem2 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem3 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem4 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem5 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem6 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem7 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem8 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem9 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem10 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem11 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem12 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem13 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem14 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem15 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem16 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem17 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem18 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem19 = new HZH_Controls.Controls.PieItem();
HZH_Controls.Controls.PieItem pieItem20 = new HZH_Controls.Controls.PieItem();
this.ucPieChart1 = new HZH_Controls.Controls.UCPieChart();
this.ucPieChart2 = new HZH_Controls.Controls.UCPieChart();
this.ucPieChart3 = new HZH_Controls.Controls.UCPieChart();
this.ucPieChart4 = new HZH_Controls.Controls.UCPieChart();
this.SuspendLayout();
//
// ucPieChart1
//
this.ucPieChart1.BackColor = System.Drawing.Color.Transparent;
this.ucPieChart1.CenterOfCircleColor = System.Drawing.Color.White;
this.ucPieChart1.CenterOfCircleWidth = 0;
pieItem1.Name = "Source1";
pieItem1.PieColor = null;
pieItem1.Value = 27;
pieItem2.Name = "Source2";
pieItem2.PieColor = null;
pieItem2.Value = 20;
pieItem3.Name = "Source3";
pieItem3.PieColor = null;
pieItem3.Value = 94;
pieItem4.Name = "Source4";
pieItem4.PieColor = null;
pieItem4.Value = 28;
pieItem5.Name = "Source5";
pieItem5.PieColor = null;
pieItem5.Value = 84;
this.ucPieChart1.DataSource = new HZH_Controls.Controls.PieItem[] {
pieItem1,
pieItem2,
pieItem3,
pieItem4,
pieItem5};
this.ucPieChart1.IsRenderPercent = true;
this.ucPieChart1.Location = new System.Drawing.Point(50, 71);
this.ucPieChart1.Name = "ucPieChart1";
this.ucPieChart1.Size = new System.Drawing.Size(342, 298);
this.ucPieChart1.TabIndex = 1;
this.ucPieChart1.TiTle = null;
this.ucPieChart1.TitleFont = new System.Drawing.Font("微软雅黑", 12F);
this.ucPieChart1.TitleFroeColor = System.Drawing.Color.Black;
//
// ucPieChart2
//
this.ucPieChart2.BackColor = System.Drawing.Color.Transparent;
this.ucPieChart2.CenterOfCircleColor = System.Drawing.Color.White;
this.ucPieChart2.CenterOfCircleWidth = 0;
pieItem6.Name = "Source1";
pieItem6.PieColor = null;
pieItem6.Value = 27;
pieItem7.Name = "Source2";
pieItem7.PieColor = null;
pieItem7.Value = 20;
pieItem8.Name = "Source3";
pieItem8.PieColor = null;
pieItem8.Value = 94;
pieItem9.Name = "Source4";
pieItem9.PieColor = null;
pieItem9.Value = 28;
pieItem10.Name = "Source5";
pieItem10.PieColor = null;
pieItem10.Value = 84;
this.ucPieChart2.DataSource = new HZH_Controls.Controls.PieItem[] {
pieItem6,
pieItem7,
pieItem8,
pieItem9,
pieItem10};
this.ucPieChart2.Location = new System.Drawing.Point(415, 18);
this.ucPieChart2.Name = "ucPieChart2";
this.ucPieChart2.Size = new System.Drawing.Size(342, 351);
this.ucPieChart2.TabIndex = 0;
this.ucPieChart2.TiTle = "有标题的饼状图";
this.ucPieChart2.TitleFont = new System.Drawing.Font("微软雅黑", 12F);
this.ucPieChart2.TitleFroeColor = System.Drawing.Color.Black;
//
// ucPieChart3
//
this.ucPieChart3.BackColor = System.Drawing.Color.Transparent;
this.ucPieChart3.CenterOfCircleColor = System.Drawing.Color.White;
this.ucPieChart3.CenterOfCircleWidth = 150;
pieItem11.Name = "Source1";
pieItem11.PieColor = null;
pieItem11.Value = 27;
pieItem12.Name = "Source2";
pieItem12.PieColor = null;
pieItem12.Value = 20;
pieItem13.Name = "Source3";
pieItem13.PieColor = null;
pieItem13.Value = 94;
pieItem14.Name = "Source4";
pieItem14.PieColor = null;
pieItem14.Value = 28;
pieItem15.Name = "Source5";
pieItem15.PieColor = null;
pieItem15.Value = 84;
this.ucPieChart3.DataSource = new HZH_Controls.Controls.PieItem[] {
pieItem11,
pieItem12,
pieItem13,
pieItem14,
pieItem15};
this.ucPieChart3.Location = new System.Drawing.Point(415, 393);
this.ucPieChart3.Name = "ucPieChart3";
this.ucPieChart3.Size = new System.Drawing.Size(342, 351);
this.ucPieChart3.TabIndex = 0;
this.ucPieChart3.TiTle = "有标题的饼状图";
this.ucPieChart3.TitleFont = new System.Drawing.Font("微软雅黑", 12F);
this.ucPieChart3.TitleFroeColor = System.Drawing.Color.Black;
//
// ucPieChart4
//
this.ucPieChart4.BackColor = System.Drawing.Color.Transparent;
this.ucPieChart4.CenterOfCircleColor = System.Drawing.Color.White;
this.ucPieChart4.CenterOfCircleWidth = 150;
pieItem16.Name = "Source1";
pieItem16.PieColor = null;
pieItem16.Value = 27;
pieItem17.Name = "Source2";
pieItem17.PieColor = null;
pieItem17.Value = 20;
pieItem18.Name = "Source3";
pieItem18.PieColor = null;
pieItem18.Value = 94;
pieItem19.Name = "Source4";
pieItem19.PieColor = null;
pieItem19.Value = 28;
pieItem20.Name = "Source5";
pieItem20.PieColor = null;
pieItem20.Value = 84;
this.ucPieChart4.DataSource = new HZH_Controls.Controls.PieItem[] {
pieItem16,
pieItem17,
pieItem18,
pieItem19,
pieItem20};
this.ucPieChart4.IsRenderPercent = true;
this.ucPieChart4.Location = new System.Drawing.Point(50, 424);
this.ucPieChart4.Name = "ucPieChart4";
this.ucPieChart4.Size = new System.Drawing.Size(342, 320);
this.ucPieChart4.TabIndex = 1;
this.ucPieChart4.TiTle = null;
this.ucPieChart4.TitleFont = new System.Drawing.Font("微软雅黑", 12F);
this.ucPieChart4.TitleFroeColor = System.Drawing.Color.Black;
//
// UCTestPieCharts
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.ucPieChart4);
this.Controls.Add(this.ucPieChart1);
this.Controls.Add(this.ucPieChart3);
this.Controls.Add(this.ucPieChart2);
this.Name = "UCTestPieCharts";
this.Size = new System.Drawing.Size(813, 766);
this.Load += new System.EventHandler(this.UCTestPieCharts_Load);
this.ResumeLayout(false);
}
#endregion
private HZH_Controls.Controls.UCPieChart ucPieChart2;
private HZH_Controls.Controls.UCPieChart ucPieChart1;
private HZH_Controls.Controls.UCPieChart ucPieChart3;
private HZH_Controls.Controls.UCPieChart ucPieChart4;
}
}
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
{
[ToolboxItem(false)]
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);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!