📄 chartsample.cs
字号:
#region Copyright ?005, Cristi Potlog - All Rights Reserved
/* -------------------------------------------------------------- *
* Copyright ?005, Cristi Potlog - All Rights reserved *
* *
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY *
* OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT *
* LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR *
* FITNESS FOR A PARTICULAR PURPOSE. *
* *
* THIS COPYRIGHT NOTICE MAY NOT BE REMOVED FROM THIS FILE. *
* -------------------------------------------------------------- */
#endregion Copyright ?005, Cristi Potlog - All Rights Reserved
#region References
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
#endregion
namespace CristiPotlog.ChartSample
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class ChartSample : System.Windows.Forms.Form
{
#region Designer generated code
private CristiPotlog.ChartControl.Chart chart1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
#endregion
#region Constructor&Dispose
/// <summary>
/// Creates a new instance of the <see cref="ChartSample"/> class.
/// </summary>
public ChartSample()
{
// required for designer support
this.InitializeComponent();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (this.components != null)
{
this.components.Dispose();
}
}
base.Dispose(disposing);
}
#endregion
#region Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
CristiPotlog.ChartControl.ChartSeriesValue chartSeriesValue1 = new CristiPotlog.ChartControl.ChartSeriesValue(new System.DateTime(2005, 6, 1, 0, 0, 0, 0), new decimal(new int[] {
30,
0,
0,
0}));
CristiPotlog.ChartControl.ChartSeriesValue chartSeriesValue2 = new CristiPotlog.ChartControl.ChartSeriesValue(new System.DateTime(2005, 6, 15, 0, 0, 0, 0), new decimal(new int[] {
60,
0,
0,
0}));
CristiPotlog.ChartControl.ChartSeriesValue chartSeriesValue3 = new CristiPotlog.ChartControl.ChartSeriesValue(new System.DateTime(2005, 7, 1, 0, 0, 0, 0), new decimal(new int[] {
40,
0,
0,
0}));
CristiPotlog.ChartControl.ChartSeriesValue chartSeriesValue4 = new CristiPotlog.ChartControl.ChartSeriesValue(new System.DateTime(2005, 7, 15, 0, 0, 0, 0), new decimal(new int[] {
50,
0,
0,
0}));
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChartSample));
this.chart1 = new CristiPotlog.ChartControl.Chart();
this.SuspendLayout();
//
// chart1
//
this.chart1.Dock = System.Windows.Forms.DockStyle.Fill;
this.chart1.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.chart1.Grid.Line.Color = System.Drawing.SystemColors.GrayText;
this.chart1.Grid.Line.Dash = System.Drawing.Drawing2D.DashStyle.Dot;
this.chart1.Legend.Border.Color = System.Drawing.SystemColors.GrayText;
this.chart1.Legend.Border.Dash = System.Drawing.Drawing2D.DashStyle.Dash;
this.chart1.Legend.Position = CristiPotlog.ChartControl.ChartLegendPosition.Bottom;
this.chart1.Legend.Visible = true;
this.chart1.Location = new System.Drawing.Point(0, 0);
this.chart1.Name = "chart1";
this.chart1.Series.Line.Color = System.Drawing.Color.Blue;
this.chart1.Series.Mark.BorderColor = System.Drawing.Color.DarkBlue;
this.chart1.Series.Mark.FillColor = System.Drawing.Color.DeepSkyBlue;
this.chart1.Series.Projections.Labels.Rotation = -30F;
this.chart1.Series.Projections.Line.Color = System.Drawing.SystemColors.GrayText;
this.chart1.Series.Projections.Line.Dash = System.Drawing.Drawing2D.DashStyle.Dash;
this.chart1.Series.Projections.Visible = true;
this.chart1.Series.Title.Text = "sample series";
chartSeriesValue1.Date = new System.DateTime(2005, 6, 1, 0, 0, 0, 0);
chartSeriesValue1.Value = new decimal(new int[] {
30,
0,
0,
0});
chartSeriesValue2.Date = new System.DateTime(2005, 6, 15, 0, 0, 0, 0);
chartSeriesValue2.Value = new decimal(new int[] {
60,
0,
0,
0});
chartSeriesValue3.Date = new System.DateTime(2005, 7, 1, 0, 0, 0, 0);
chartSeriesValue3.Value = new decimal(new int[] {
40,
0,
0,
0});
chartSeriesValue4.Date = new System.DateTime(2005, 7, 15, 0, 0, 0, 0);
chartSeriesValue4.Value = new decimal(new int[] {
50,
0,
0,
0});
this.chart1.Series.Values.AddRange(new CristiPotlog.ChartControl.ChartSeriesValue[] {
chartSeriesValue1,
chartSeriesValue2,
chartSeriesValue3,
chartSeriesValue4});
this.chart1.Size = new System.Drawing.Size(412, 294);
this.chart1.TabIndex = 0;
this.chart1.Title.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.chart1.Title.Text = "Chart with sample data";
this.chart1.XAxis.Line.Color = System.Drawing.SystemColors.WindowText;
this.chart1.XAxis.Scale.Maximum = new System.DateTime(2005, 7, 17, 0, 0, 0, 0);
this.chart1.XAxis.Scale.Minimum = new System.DateTime(2005, 5, 30, 0, 0, 0, 0);
this.chart1.YAxis.Title.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.chart1.Click += new System.EventHandler(this.chart1_Click);
//
// ChartSample
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(412, 294);
this.Controls.Add(this.chart1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "ChartSample";
this.Text = "Chart Sample";
this.ResumeLayout(false);
}
#endregion
private void chart1_Click(object sender, EventArgs e)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -