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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Resizing

Thread ID:

Created:

Updated:

Platform:

Replies:

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

Hello,

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

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.
this.chartControl1.Legend.Items[0].VisibleCheckBox=true;

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

this.chartControl1.PrimaryXAxis.VisibleRange.Max
this.chartControl1.PrimaryYAxis.VisibleRange.Max

Please let me know if this helps.

Regards,
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;
}
else
{
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:

this.chartControl1.Series[0].Summary.MaxX
this.chartControl1.Series[0].Summary.MaxY


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.

Regards,
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.

Regards,
Senthil Ganesh K.

CONFIRMATION

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.

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

;