Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6554713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:43:57+00:00 2026-05-25T12:43:57+00:00

I am implementing chart controls …. I have three forms say form1 form2 form3

  • 0

I am implementing chart controls ….
I have three forms say form1 form2 form3 …..

in form1 I am showing some data in the form of pie chart

form2 i am showing some data in the form of bar chart .. thats working fine …

my problem is i want to show these two charts in form 3 like over view form… where the user will see all charts …

So when i click on the button the form 3 will be open with the two charts side by side (one is pie chart in form1 , another one is bar chart in form2) if you click on the one of the chart in form3 it will goes to the corresponding form..like this….

would any one have any idea about this how to implement …

Many Thanks in advance….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:43:58+00:00Added an answer on May 25, 2026 at 12:43 pm

    I would do something this:

    1) Create 2 user controls containing a mschart, and call them e.g. PieChartControl and BarChartControl. Expose a a method to set the current datasource (e.g. SetDataSource(DataTable dt) ) and put there the logic to bind the datasource to the PieChart or the BarChart

    2) Create the 3 forms: in Form1 add PieChartControl, in Form2 add BarChartControl and in Form3 add a SplitContainer where you will add both a PieChartControl and a BarChartControl.

    3) Expose SetDataSource() method also in Form1 and Form2 (it will just call the corresponding inner control method)

    4) Expose also SetDataSource() method in Form3; it will call both SetDataSource() methods of inner PieChartControl and BarChartControl.

    5) Form3 has to expose also a custom property (e.g. ChartClicked ) indicating the chart that has been clicked

    6) In Form3 subscribe the Click event (or DoubleClick, as you wish) for PieChartControl and BarChartControl

    7) When Click event is triggered, just set the ChartClicked property and close the form


    It will follow some code samples to help you understand my explanation.

    Helper enum:

    public enum ChartClicked {  None = 0, Pie = 1, Bar = 2 }
    

    MainForm:

    // this is the form that have the button to open Form3
    public partial class MainForm: Form
    {
       // other methods ...
    
       private void openForm3ButtonClick(object sender,Eventargs e)
       {
          Form3 f3 = new Form3();
          f3.SetDataSource(this.dataSrc)
          f3.ShowDialog();
    
          if(f3.ChartClicked == ChartClicked .Pie)
          {
             Form1 f1 = new Form1();
             f1.SetDataSource(this.dataSrc);
             f1.ShowDialog();
          }
          else if(f3.ChartClicked == ChartClicked .Bar)
          {
             Form2 f2 = new Form2();
             f2.SetDataSource(this.dataSrc);
             f2.ShowDialog();
          }    
       }
    }
    

    Form3:

    // the form having the 2 controls
    public partial class Form3: Form
    {
       // other methods ...
    
       public ChartClicked ChartClicked { get; private set; }
    
       public Form3()
       {
          this.InitializeComponents();
          this.PieChartControl.Click += chartControlClicked;
          this.BarChartControl.Click += chartControlClicked;
       } 
    
       public void SetDataSource(object src)
       {
          this.PieChartControl.SetDataSource(src);
          this.BarChartControl.SetDataSource(src);
       }
    
       private void chartControlClicked(object sender, EventArgs e)
       { 
          if(sender == this.PieChartControl)
              this.ChartClicked = ChartClicked .Pie;
          else if(sender == this.BarChartControl)
              this.ChartClicked = ChartClicked .Bar;
          this.Close();
       }
    }
    

    Form1:

    // the form having the pie chart control
    public partial class Form1: Form
    {
       // other methods ...
    
       public void SetDataSource(object src)
       {
          this.PieChartControl.SetDataSource(src);
       }
    }
    

    Form2:

    // the form having the bar chart control
    public partial class Form2: Form
    {
       // other methods ...
    
       public void SetDataSource(object src)
       {
          this.BarChartControl.SetDataSource(src);
       }
    }
    

    PieChartControl:

    public partial PieChartControl: UserControl
    {
       // other methods ...
       public void SetDataSource(object src)
       {
          // set the series type to Pie etc... 
          this.chart.DataSource = src;
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When implementing Quicksort, one of the things you have to do is to choose
I'm implementing a scatter plot using the MS Chart Control .NET 3.5, WinForms, C#.
I have a std::vector that holds a Point struct (x,y,z and some other non-pointer
I'm implementing shipping into my application and I have problems with polish chars. On
I am new to Rails and am just implementing some basic applications. Just starting
I'm implementing charts using The Ziya Charts Gem . Unfortunately, the documentation isn't really
What's my best bet for implementing a simple chat client (2-person) in an ASP.NET
Implementing Equals() for reference types is harder than it seems. My current canonical implementation
Implementing a 'sandbox' environment in Python used to be done with the rexec module
When implementing a needle search of a haystack in an object-oriented way, you essentially

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.