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. Image for the cookie policy date

Removing YAxis when Legend CheckBox in not selected

Hi!

I was wondering, how i can make YAxis of a certain series dissapear when i deselect this series in the chart legend. The series itself dissapears as expected, but the YAxis stays in place which is no good.

I add the series like this:
public AddSeries()
{
this.StrokeThickness = 2;
this.Type = ChartTypes.StepLine;
this.IsIndexed = false;
this.BindingPathX = "Value1";
this.BindingPathsY = new string[] { "Value2" };
this.YAxis = new ChartAxis();
this.YAxis.Orientation = Orientation.Vertical;
}

Thanks for the help,
Tadej Abina


5 Replies

AD Administrator Syncfusion Team October 22, 2008 12:37 PM UTC

Hi Tadeja,

Thanks for your interests in Syncfusion products.

By default, we do not have options to remove the ChartAxis along with ChartSeries. Because there might be other ChartSeries that might share the same ChartAxis.

But your requirement can be achieved by applying a custom DataTemplate to ItemsTemplate property of ChartLegend class. In the DataTemplate a click event for the CheckBox can be added and corresponding ChartAxis can be removed manually using the click event handler.

I have created a sample on it and it is attached for your reference.

Please let us know if you have further queries.

Regards,
Athaur Rahman GS



ChartLegendsSample_9c434c8b.zip


AD Administrator Syncfusion Team October 23, 2008 06:58 AM UTC

Hey!

Thanks for the help, works like a charm :)

One more thing though-how can i tell the YAxis Header to display vertically immediatelly...it displays horizontally for a brief moment, then switches to vertical.

regards,
Tadej Abina



AD Administrator Syncfusion Team October 23, 2008 01:24 PM UTC


Hi Tadeja,

Thanks for your interests in Syncfusion products.

I am not able to reproduce the issue mentioned by you with the sample that I sent you yesterday. If you are reproducing it on a different sample kindly update us with the sample to try and reproduce this issue.

Please let us know if you have further queries.

Regards,
Athaur Rahman GS



AD Administrator Syncfusion Team October 28, 2008 10:03 AM UTC

Hey!

The YAxis header problem is not a problem anymore :)

But i do have some new ones:
1. If i create a chart area and dont add any series at first, there is obviously no legend to show. But when i start adding the series, the legend is still not there as if it was not updating.
2. The rendering of series when there is f.e. mora than 200 data points is very slow...is there a way to make it faster, besides Begin/EndUpdate? Series are drawn based on collections that are made beforehand.
3. Does EssentialChart have a problem with WindowsVista? I had no errors working with it on my Windows XP, but my co-worker tried to run the application on Windows Vista and it crashed every single time. It works atm, but only because we limited the number of data points to 100. Any thoughts?

Thank you in advance for all your help!

regards, Tadej Abina



AD Administrator Syncfusion Team October 28, 2008 01:22 PM UTC


Hi Tadeja,

Thanks for your interests in Syncfusion products. The following are the responses for your queries.

Regarding chart series not getting displayed in the legends, it can be overcome by setting the ItemsSource of the chart legends. I have attached the updated the sample for your reference.

Regarding more data points, we could see the chart getting loaded and working as normal for more than 1000 points also. Attached sample also creates series with 1000 points.

Regarding working in vista, we do not have any issues working with Vista. Kindly update us with a sample to reproduce the issue.

Please let us know if you have further queries.

Regards,
Athaur Rahman GS



ChartLegendsSample_e961b57e.zip

Loader.
Live Chat Icon For mobile
Up arrow icon