HOW TO USE CHART CONTROLS IN WINDOWS FORMS APPLICATION IN .NET

Ankit Singh

Total Post:341

Points:2389
Posted by  Ankit Singh
.NET 
 607  View(s)
Ratings:
Rate this:
I want to use  Chart Controls in Windows Forms Application in .net. please give me a demo.
  1. aditya kumar Patel

    Post:254

    Points:1810
    Re: How to use Chart Controls in Windows Forms Application in .net

     we will see how to use the Chart control in Windows Forms Applications. As we know Charts and Graphs make data easier to understand .

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Windows.Forms.DataVisualization.Charting;
    namespace WindowsForums
    {
        public partial class Chart : Form
        {
            public Chart()
            {
                InitializeComponent();
            }

            private void Chart_Load(object sender, EventArgs e)
            {
               
                string[] seriesarr = { "Jan", "Feb", "MAR", };
                int[] pointsArray = { 1000, 2000,1500 };           
                this.chart1.Palette = ChartColorPalette.Pastel;           
                this.chart1.Titles.Add("Sales");            
                for (int i = 0; i < seriesarr.Length; i++)
                {             
                    Series series = this.chart1.Series.Add(seriesarr[i]);         
                    series.Points.Add(pointsArray[i]);
                }
            }
        }
    }

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!