Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Charting in .NET 4

, 19 Sep 2012
Introduction to Charts in .NET 4
Charting-noexe.zip
WindowsFormsApplication1
WindowsFormsApplication1
Properties
DataSources
System.Windows.Forms.DataVisualization.Charting.Annotation.datasource
System.Windows.Forms.DataVisualization.Charting.AnnotationCollection.datasource
System.Windows.Forms.DataVisualization.Charting.AnnotationGroup.datasource
System.Windows.Forms.DataVisualization.Charting.AnnotationPathPoint.datasource
System.Windows.Forms.DataVisualization.Charting.AnnotationPathPointCollection.datasource
System.Windows.Forms.DataVisualization.Charting.AnnotationPositionChangingEventArgs.datasource
System.Windows.Forms.DataVisualization.Charting.AnnotationSmartLabelStyle.datasource
System.Windows.Forms.DataVisualization.Charting.AnovaResult.datasource
System.Windows.Forms.DataVisualization.Charting.ArrowAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.Axis.datasource
System.Windows.Forms.DataVisualization.Charting.AxisScaleBreakStyle.datasource
System.Windows.Forms.DataVisualization.Charting.AxisScaleView.datasource
System.Windows.Forms.DataVisualization.Charting.AxisScrollBar.datasource
System.Windows.Forms.DataVisualization.Charting.Border3DAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.BorderSkin.datasource
System.Windows.Forms.DataVisualization.Charting.CalloutAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.Chart.datasource
System.Windows.Forms.DataVisualization.Charting.ChartArea.datasource
System.Windows.Forms.DataVisualization.Charting.ChartArea3DStyle.datasource
System.Windows.Forms.DataVisualization.Charting.ChartAreaCollection.datasource
System.Windows.Forms.DataVisualization.Charting.ChartElement.datasource
System.Windows.Forms.DataVisualization.Charting.ChartElementOutline.datasource
System.Windows.Forms.DataVisualization.Charting.ChartGraphics.datasource
System.Windows.Forms.DataVisualization.Charting.ChartNamedElement.datasource
System.Windows.Forms.DataVisualization.Charting.ChartPaintEventArgs.datasource
System.Windows.Forms.DataVisualization.Charting.ChartSerializer.datasource
System.Windows.Forms.DataVisualization.Charting.Cursor.datasource
System.Windows.Forms.DataVisualization.Charting.CursorEventArgs.datasource
System.Windows.Forms.DataVisualization.Charting.CustomizeLegendEventArgs.datasource
System.Windows.Forms.DataVisualization.Charting.CustomLabel.datasource
System.Windows.Forms.DataVisualization.Charting.CustomLabelsCollection.datasource
System.Windows.Forms.DataVisualization.Charting.CustomProperties.datasource
System.Windows.Forms.DataVisualization.Charting.DataFormula.datasource
System.Windows.Forms.DataVisualization.Charting.DataManipulator.datasource
System.Windows.Forms.DataVisualization.Charting.DataPoint.datasource
System.Windows.Forms.DataVisualization.Charting.DataPointCollection.datasource
System.Windows.Forms.DataVisualization.Charting.DataPointComparer.datasource
System.Windows.Forms.DataVisualization.Charting.DataPointCustomProperties.datasource
System.Windows.Forms.DataVisualization.Charting.ElementPosition.datasource
System.Windows.Forms.DataVisualization.Charting.EllipseAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.FormatNumberEventArgs.datasource
System.Windows.Forms.DataVisualization.Charting.FTestResult.datasource
System.Windows.Forms.DataVisualization.Charting.Grid.datasource
System.Windows.Forms.DataVisualization.Charting.HitTestResult.datasource
System.Windows.Forms.DataVisualization.Charting.HorizontalLineAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.IDataPointFilter.datasource
System.Windows.Forms.DataVisualization.Charting.ImageAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.LabelStyle.datasource
System.Windows.Forms.DataVisualization.Charting.Legend.datasource
System.Windows.Forms.DataVisualization.Charting.LegendCell.datasource
System.Windows.Forms.DataVisualization.Charting.LegendCellCollection.datasource
System.Windows.Forms.DataVisualization.Charting.LegendCellColumn.datasource
System.Windows.Forms.DataVisualization.Charting.LegendCellColumnCollection.datasource
System.Windows.Forms.DataVisualization.Charting.LegendCollection.datasource
System.Windows.Forms.DataVisualization.Charting.LegendItem.datasource
System.Windows.Forms.DataVisualization.Charting.LegendItemsCollection.datasource
System.Windows.Forms.DataVisualization.Charting.LineAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.Margins.datasource
System.Windows.Forms.DataVisualization.Charting.NamedImage.datasource
System.Windows.Forms.DataVisualization.Charting.NamedImagesCollection.datasource
System.Windows.Forms.DataVisualization.Charting.Point3D.datasource
System.Windows.Forms.DataVisualization.Charting.PolygonAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.PolylineAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.PrintingManager.datasource
System.Windows.Forms.DataVisualization.Charting.RectangleAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.ScrollBarEventArgs.datasource
System.Windows.Forms.DataVisualization.Charting.Series.datasource
System.Windows.Forms.DataVisualization.Charting.SeriesCollection.datasource
System.Windows.Forms.DataVisualization.Charting.SmartLabelStyle.datasource
System.Windows.Forms.DataVisualization.Charting.StatisticFormula.datasource
System.Windows.Forms.DataVisualization.Charting.StripLine.datasource
System.Windows.Forms.DataVisualization.Charting.StripLinesCollection.datasource
System.Windows.Forms.DataVisualization.Charting.TextAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.TickMark.datasource
System.Windows.Forms.DataVisualization.Charting.Title.datasource
System.Windows.Forms.DataVisualization.Charting.TitleCollection.datasource
System.Windows.Forms.DataVisualization.Charting.ToolTipEventArgs.datasource
System.Windows.Forms.DataVisualization.Charting.TTestResult.datasource
System.Windows.Forms.DataVisualization.Charting.VerticalLineAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.ViewEventArgs.datasource
System.Windows.Forms.DataVisualization.Charting.ZTestResult.datasource
Settings.settings
WindowsFormsApplication1.suo
Charting.zip
bin
Release
WindowsFormsApplication1.exe
System.Windows.Forms.DataVisualization.Charting.Annotation.datasource
System.Windows.Forms.DataVisualization.Charting.AnnotationCollection.datasource
System.Windows.Forms.DataVisualization.Charting.AnnotationGroup.datasource
System.Windows.Forms.DataVisualization.Charting.AnnotationPathPoint.datasource
System.Windows.Forms.DataVisualization.Charting.AnnotationPathPointCollection.datasource
System.Windows.Forms.DataVisualization.Charting.AnnotationPositionChangingEventArgs.datasource
System.Windows.Forms.DataVisualization.Charting.AnnotationSmartLabelStyle.datasource
System.Windows.Forms.DataVisualization.Charting.AnovaResult.datasource
System.Windows.Forms.DataVisualization.Charting.ArrowAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.Axis.datasource
System.Windows.Forms.DataVisualization.Charting.AxisScaleBreakStyle.datasource
System.Windows.Forms.DataVisualization.Charting.AxisScaleView.datasource
System.Windows.Forms.DataVisualization.Charting.AxisScrollBar.datasource
System.Windows.Forms.DataVisualization.Charting.Border3DAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.BorderSkin.datasource
System.Windows.Forms.DataVisualization.Charting.CalloutAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.Chart.datasource
System.Windows.Forms.DataVisualization.Charting.ChartArea.datasource
System.Windows.Forms.DataVisualization.Charting.ChartArea3DStyle.datasource
System.Windows.Forms.DataVisualization.Charting.ChartAreaCollection.datasource
System.Windows.Forms.DataVisualization.Charting.ChartElement.datasource
System.Windows.Forms.DataVisualization.Charting.ChartElementOutline.datasource
System.Windows.Forms.DataVisualization.Charting.ChartGraphics.datasource
System.Windows.Forms.DataVisualization.Charting.ChartNamedElement.datasource
System.Windows.Forms.DataVisualization.Charting.ChartPaintEventArgs.datasource
System.Windows.Forms.DataVisualization.Charting.ChartSerializer.datasource
System.Windows.Forms.DataVisualization.Charting.Cursor.datasource
System.Windows.Forms.DataVisualization.Charting.CursorEventArgs.datasource
System.Windows.Forms.DataVisualization.Charting.CustomizeLegendEventArgs.datasource
System.Windows.Forms.DataVisualization.Charting.CustomLabel.datasource
System.Windows.Forms.DataVisualization.Charting.CustomLabelsCollection.datasource
System.Windows.Forms.DataVisualization.Charting.CustomProperties.datasource
System.Windows.Forms.DataVisualization.Charting.DataFormula.datasource
System.Windows.Forms.DataVisualization.Charting.DataManipulator.datasource
System.Windows.Forms.DataVisualization.Charting.DataPoint.datasource
System.Windows.Forms.DataVisualization.Charting.DataPointCollection.datasource
System.Windows.Forms.DataVisualization.Charting.DataPointComparer.datasource
System.Windows.Forms.DataVisualization.Charting.DataPointCustomProperties.datasource
System.Windows.Forms.DataVisualization.Charting.ElementPosition.datasource
System.Windows.Forms.DataVisualization.Charting.EllipseAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.FormatNumberEventArgs.datasource
System.Windows.Forms.DataVisualization.Charting.FTestResult.datasource
System.Windows.Forms.DataVisualization.Charting.Grid.datasource
System.Windows.Forms.DataVisualization.Charting.HitTestResult.datasource
System.Windows.Forms.DataVisualization.Charting.HorizontalLineAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.IDataPointFilter.datasource
System.Windows.Forms.DataVisualization.Charting.ImageAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.LabelStyle.datasource
System.Windows.Forms.DataVisualization.Charting.Legend.datasource
System.Windows.Forms.DataVisualization.Charting.LegendCell.datasource
System.Windows.Forms.DataVisualization.Charting.LegendCellCollection.datasource
System.Windows.Forms.DataVisualization.Charting.LegendCellColumn.datasource
System.Windows.Forms.DataVisualization.Charting.LegendCellColumnCollection.datasource
System.Windows.Forms.DataVisualization.Charting.LegendCollection.datasource
System.Windows.Forms.DataVisualization.Charting.LegendItem.datasource
System.Windows.Forms.DataVisualization.Charting.LegendItemsCollection.datasource
System.Windows.Forms.DataVisualization.Charting.LineAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.Margins.datasource
System.Windows.Forms.DataVisualization.Charting.NamedImage.datasource
System.Windows.Forms.DataVisualization.Charting.NamedImagesCollection.datasource
System.Windows.Forms.DataVisualization.Charting.Point3D.datasource
System.Windows.Forms.DataVisualization.Charting.PolygonAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.PolylineAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.PrintingManager.datasource
System.Windows.Forms.DataVisualization.Charting.RectangleAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.ScrollBarEventArgs.datasource
System.Windows.Forms.DataVisualization.Charting.Series.datasource
System.Windows.Forms.DataVisualization.Charting.SeriesCollection.datasource
System.Windows.Forms.DataVisualization.Charting.SmartLabelStyle.datasource
System.Windows.Forms.DataVisualization.Charting.StatisticFormula.datasource
System.Windows.Forms.DataVisualization.Charting.StripLine.datasource
System.Windows.Forms.DataVisualization.Charting.StripLinesCollection.datasource
System.Windows.Forms.DataVisualization.Charting.TextAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.TickMark.datasource
System.Windows.Forms.DataVisualization.Charting.Title.datasource
System.Windows.Forms.DataVisualization.Charting.TitleCollection.datasource
System.Windows.Forms.DataVisualization.Charting.ToolTipEventArgs.datasource
System.Windows.Forms.DataVisualization.Charting.TTestResult.datasource
System.Windows.Forms.DataVisualization.Charting.VerticalLineAnnotation.datasource
System.Windows.Forms.DataVisualization.Charting.ViewEventArgs.datasource
System.Windows.Forms.DataVisualization.Charting.ZTestResult.datasource
Settings.settings
WindowsFormsApplication1.suo
ChartingExe.zip
namespace WindowsFormsApplication1
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form 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()
        {
            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
            System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
            System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
            this.DynamicChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
            this.txtX1 = new System.Windows.Forms.TextBox();
            this.lblXAxisData = new System.Windows.Forms.Label();
            this.lblYAxisData = new System.Windows.Forms.Label();
            this.txtX2 = new System.Windows.Forms.TextBox();
            this.txtX3 = new System.Windows.Forms.TextBox();
            this.txtX4 = new System.Windows.Forms.TextBox();
            this.txtX5 = new System.Windows.Forms.TextBox();
            this.txtY5 = new System.Windows.Forms.TextBox();
            this.txtY4 = new System.Windows.Forms.TextBox();
            this.txtY3 = new System.Windows.Forms.TextBox();
            this.txtY2 = new System.Windows.Forms.TextBox();
            this.txtY1 = new System.Windows.Forms.TextBox();
            this.btnPlotChart = new System.Windows.Forms.Button();
            this.label1 = new System.Windows.Forms.Label();
            this.comboBoxChartType = new System.Windows.Forms.ComboBox();
            ((System.ComponentModel.ISupportInitialize)(this.DynamicChart)).BeginInit();
            this.SuspendLayout();
            // 
            // DynamicChart
            // 
            chartArea1.Name = "ChartArea1";
            this.DynamicChart.ChartAreas.Add(chartArea1);
            legend1.Name = "Legend1";
            this.DynamicChart.Legends.Add(legend1);
            this.DynamicChart.Location = new System.Drawing.Point(12, 12);
            this.DynamicChart.Name = "DynamicChart";
            series1.ChartArea = "ChartArea1";
            series1.Legend = "Legend1";
            series1.Name = "UserDataSeries";
            this.DynamicChart.Series.Add(series1);
            this.DynamicChart.Size = new System.Drawing.Size(346, 263);
            this.DynamicChart.TabIndex = 1;
            this.DynamicChart.Text = "chart2";
            // 
            // txtX1
            // 
            this.txtX1.Location = new System.Drawing.Point(104, 329);
            this.txtX1.Name = "txtX1";
            this.txtX1.Size = new System.Drawing.Size(46, 20);
            this.txtX1.TabIndex = 2;
            this.txtX1.Text = "1";
            // 
            // lblXAxisData
            // 
            this.lblXAxisData.AutoSize = true;
            this.lblXAxisData.Location = new System.Drawing.Point(9, 332);
            this.lblXAxisData.Name = "lblXAxisData";
            this.lblXAxisData.Size = new System.Drawing.Size(89, 13);
            this.lblXAxisData.TabIndex = 3;
            this.lblXAxisData.Text = "X-Axis Data Point";
            // 
            // lblYAxisData
            // 
            this.lblYAxisData.AutoSize = true;
            this.lblYAxisData.Location = new System.Drawing.Point(9, 372);
            this.lblYAxisData.Name = "lblYAxisData";
            this.lblYAxisData.Size = new System.Drawing.Size(89, 13);
            this.lblYAxisData.TabIndex = 4;
            this.lblYAxisData.Text = "Y-Axis Data Point";
            // 
            // txtX2
            // 
            this.txtX2.Location = new System.Drawing.Point(156, 329);
            this.txtX2.Name = "txtX2";
            this.txtX2.Size = new System.Drawing.Size(46, 20);
            this.txtX2.TabIndex = 5;
            this.txtX2.Text = "2";
            // 
            // txtX3
            // 
            this.txtX3.Location = new System.Drawing.Point(208, 329);
            this.txtX3.Name = "txtX3";
            this.txtX3.Size = new System.Drawing.Size(46, 20);
            this.txtX3.TabIndex = 6;
            this.txtX3.Text = "3";
            // 
            // txtX4
            // 
            this.txtX4.Location = new System.Drawing.Point(260, 329);
            this.txtX4.Name = "txtX4";
            this.txtX4.Size = new System.Drawing.Size(46, 20);
            this.txtX4.TabIndex = 7;
            this.txtX4.Text = "4";
            // 
            // txtX5
            // 
            this.txtX5.Location = new System.Drawing.Point(312, 329);
            this.txtX5.Name = "txtX5";
            this.txtX5.Size = new System.Drawing.Size(46, 20);
            this.txtX5.TabIndex = 8;
            this.txtX5.Text = "5";
            // 
            // txtY5
            // 
            this.txtY5.Location = new System.Drawing.Point(312, 369);
            this.txtY5.Name = "txtY5";
            this.txtY5.Size = new System.Drawing.Size(46, 20);
            this.txtY5.TabIndex = 13;
            this.txtY5.Text = "1";
            // 
            // txtY4
            // 
            this.txtY4.Location = new System.Drawing.Point(260, 369);
            this.txtY4.Name = "txtY4";
            this.txtY4.Size = new System.Drawing.Size(46, 20);
            this.txtY4.TabIndex = 12;
            this.txtY4.Text = "2";
            // 
            // txtY3
            // 
            this.txtY3.Location = new System.Drawing.Point(208, 369);
            this.txtY3.Name = "txtY3";
            this.txtY3.Size = new System.Drawing.Size(46, 20);
            this.txtY3.TabIndex = 11;
            this.txtY3.Text = "3";
            // 
            // txtY2
            // 
            this.txtY2.Location = new System.Drawing.Point(156, 369);
            this.txtY2.Name = "txtY2";
            this.txtY2.Size = new System.Drawing.Size(46, 20);
            this.txtY2.TabIndex = 10;
            this.txtY2.Text = "4";
            // 
            // txtY1
            // 
            this.txtY1.Location = new System.Drawing.Point(104, 369);
            this.txtY1.Name = "txtY1";
            this.txtY1.Size = new System.Drawing.Size(46, 20);
            this.txtY1.TabIndex = 9;
            this.txtY1.Text = "5";
            // 
            // btnPlotChart
            // 
            this.btnPlotChart.Location = new System.Drawing.Point(275, 281);
            this.btnPlotChart.Name = "btnPlotChart";
            this.btnPlotChart.Size = new System.Drawing.Size(83, 23);
            this.btnPlotChart.TabIndex = 14;
            this.btnPlotChart.Text = "&Plot Chart";
            this.btnPlotChart.UseVisualStyleBackColor = true;
            this.btnPlotChart.Click += new System.EventHandler(this.btnPlotChart_Click);
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(12, 286);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(65, 13);
            this.label1.TabIndex = 15;
            this.label1.Text = "Chart Type: ";
            // 
            // comboBoxChartType
            // 
            this.comboBoxChartType.FormattingEnabled = true;
            this.comboBoxChartType.Location = new System.Drawing.Point(83, 283);
            this.comboBoxChartType.Name = "comboBoxChartType";
            this.comboBoxChartType.Size = new System.Drawing.Size(161, 21);
            this.comboBoxChartType.TabIndex = 16;
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(369, 394);
            this.Controls.Add(this.comboBoxChartType);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.btnPlotChart);
            this.Controls.Add(this.txtY5);
            this.Controls.Add(this.txtY4);
            this.Controls.Add(this.txtY3);
            this.Controls.Add(this.txtY2);
            this.Controls.Add(this.txtY1);
            this.Controls.Add(this.txtX5);
            this.Controls.Add(this.txtX4);
            this.Controls.Add(this.txtX3);
            this.Controls.Add(this.txtX2);
            this.Controls.Add(this.lblYAxisData);
            this.Controls.Add(this.lblXAxisData);
            this.Controls.Add(this.txtX1);
            this.Controls.Add(this.DynamicChart);
            this.Name = "Form1";
            this.Text = "Form1";
            this.Load += new System.EventHandler(this.Form1_Load);
            ((System.ComponentModel.ISupportInitialize)(this.DynamicChart)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.DataVisualization.Charting.Chart DynamicChart;
        private System.Windows.Forms.TextBox txtX1;
        private System.Windows.Forms.Label lblXAxisData;
        private System.Windows.Forms.Label lblYAxisData;
        private System.Windows.Forms.TextBox txtX2;
        private System.Windows.Forms.TextBox txtX3;
        private System.Windows.Forms.TextBox txtX4;
        private System.Windows.Forms.TextBox txtX5;
        private System.Windows.Forms.TextBox txtY5;
        private System.Windows.Forms.TextBox txtY4;
        private System.Windows.Forms.TextBox txtY3;
        private System.Windows.Forms.TextBox txtY2;
        private System.Windows.Forms.TextBox txtY1;
        private System.Windows.Forms.Button btnPlotChart;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.ComboBox comboBoxChartType;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Trilok Arora

United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web02 | 2.8.140814.1 | Last Updated 19 Sep 2012
Article Copyright 2012 by Trilok Arora
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid