Home > DeveloperSection > Forums > How to use Chart Controls in Windows Forms Application in .net
Ankit Singh

Total Post:341

Points:2389
Posted on    January-01-2016 3:00 AM

 .NET .NET 
Ratings:


 1 Reply(s)
 313  View(s)
Rate this:
I want to use  Chart Controls in Windows Forms Application in .net. please give me a demo.


aditya kumar Patel

Total Post:250

Points:1782
Posted on    January-01-2016 3:12 AM

 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]);
            }
        }
    }
}


Don't want to miss updates? Please click the below button!

Follow MindStick