We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:





93023 Feb 19,2010 08:09 AM UTC Feb 24,2010 02:59 PM UTC WinForms 6
Tags: Chart
Daniel Rottschäfer
Asked On February 19, 2010 08:09 AM UTC


i created a table in which the size will be automatically adjusted if I check or uncheck an item at the chart-legend.
How do I do that?

Best regards


Daniel Rottschäfer
Replied On February 19, 2010 11:53 AM UTC

I have a additional question:

How do i get the max value from the x- and y-axis?

Senthil Ganesh K [Syncfusion]
Replied On February 19, 2010 12:26 PM UTC

Hi Daniel,

Thanks for showing interest on Syncfusion products.

The below code is used to check all the legend items in the chart legend by setting to true.
To uncheck set it to false.
this.chartControl1.Legend.VisibleCheckBox = true;

The below code is to check each legend item individually by setting to true.
To uncheck set it to false.

The below code is to find the max value for X axis and Y axis.


Please let me know if this helps.

Senthil Ganesh K.

Daniel Rottschäfer
Replied On February 22, 2010 08:06 AM UTC

I had something else in my mind when i asked the questions.

I want the chart automatically to resize if i uncheck an legend item. The Max X- and Y-Axis Values should be the max Value of the shown series.

How can i do that?

And how do i get the maxvalue of any series without counting themselves when filling the data?

Senthil Ganesh K [Syncfusion]
Replied On February 22, 2010 01:29 PM UTC

Hi Daniel,

The chart resizing can be done by using the legend items Checked changed event.
Below mentioned example code will perform the resizing of the chart control.

Example code:

this.chartControl1.Legend.Items[0].CheckedChanged += new EventHandler(Form1_CheckedChanged);

void Form1_CheckedChanged(object sender, EventArgs e)
if (this.chartControl1.Legend.Items[0].IsChecked)
this.chartControl1.Width = 700;
this.chartControl1.Height = 700;
this.chartControl1.Height = 200;
this.chartControl1.Width = 600;

The max value for the shown series can be found out by using the below code snippet without counting the data.

Code snippet:


The below mentioned code snippet is to set the max value of the given series to the max X and Y values of the axes.

Code Snippet:

this.chartControl1.PrimaryXAxis.Range.Max = this.chartControl1.Series[0].Summary.MaxX;
this.chartControl1.PrimaryYAxis.Range.Max = this.chartControl1.Series[0].Summary.MaxY;

Please let me know if this meets your requirement.

Senthil Ganesh K.

Daniel Rottschäfer
Replied On February 23, 2010 10:37 AM UTC

Thank you for your help.

Senthil Ganesh K [Syncfusion]
Replied On February 24, 2010 02:59 PM UTC

Hi Daniel,

Thanks for using syncfusion products.

We are happy to assist you.

Senthil Ganesh K.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon