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
close icon

Save original chart axis labels

How can we add an extra text string to a Syncfusion wpf chart?

We need to store an extra hidden text string to a SyncFusion chart. Our users have the ability to edit the chart axis label as well as the data series label. We need to preserver the original label from the first time the chart is displayed to the user.

This will allow the user to revert the edited label back to the original one.

This is for a chart that the user can dynamically add data series to as well as set axis scale, etc.

We're using Syncfusion.Chart.WPF.DLL version 9.203.0.137 in a .net 4.0 WPF desktop application.



1 Reply

MP Michael Prabhu M Syncfusion Team November 4, 2011 08:49 AM UTC

Hi George,

Thanks for using Syncfusion Products, We have analyzed your requirement and it can be achieved by storing the ChartAxisLabelsCollection while loading the chart and then restoring it after editing the axis labels as in below code snippet.

Code snippet[C#]:
Storing the text:
ChartAxisLabelsCollection lc=new ChartAxisLabelsCollection();
lc=xaxis.VisibleLabels;

Restoring the text:
xaxis.LabelsSource = lc;

We have also prepared a simple sample based on your requirement which you can download from the attachment.

Please let us know if you have any concerns.

Thanks,
Michael Prabhu.



AxisLabels_32088b1b.zip

Loader.
Live Chat Icon For mobile
Up arrow icon