Thank you for clarifying your requirement. I understand what you need to implement. Unfortunately, this is not supported out of the box by our RadCartesianChart component. The axis is removed along with the corresponding series in the same dynamic manner which causes all other visual elements of the charting component to be resized.
On the other hand, the length of the labels of an axis depends on the data of the series. This makes hard to determine in advance exactly how long the labels will be so that we could reserve space. This is why all visual elements are dynamically resized when new series and/or axis is added or removed.
However, there are some custom implementations that you can try out if you insist changing the default behavior of the charting component.
If all the data of all series is know at the moment of loading your application and users control only the visibility of the separate series using those checkboxes you can try the following. You can load all series in the RadCartesianChart and then try binding the Opacity
property of the series itself and the corresponding Axis to the respective checkbox.
If the data is not known when your application is started you can try preserving the space that your labels will take with the Margin
property of the RadCartesianChart. Let me give you an example to clarify.
Lets say you know that the longest label of your series is 100 pixels in width. Your series is still not populated with data this is why you cannot load it in prior of application start. This is why you can set 100 pixels Margin
of the right side of the RadCartesianChart (Margin="0 0 100 0"). This will reserve the needed space for your labels. At the moment when you need to add the corresponding series, you should set the Margin of the chart back to 0 this should result in visualizing the series along with the axis with no resizing of the rest of the visual elements.
Please be noted that this approach has many drawbacks and this is why it is not recommended to implement it in your real life application. It is better to leave the RadCartesianChart to dynamically adjust the size of its series and axis.
Pavel R. Pavlov