How to use Chart Controls in Windows Forms Application in .net

Total Post:341

Points:2389
.NET 
 875  View(s)
Ratings:
Rate this:
I want to use  Chart Controls in Windows Forms Application in .net. please give me a demo.
  1. Post:279

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

      Modified On Apr-10-2018 06:54:11 AM

Answer

NEWSLETTER

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