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

LabelClicked event not firing when LabelRotationAngle is other than 0 degrees

If the label is rotated by 45 or 90 degrees, the LabelClicked event is not firing. It seems that the "bounding box" of the label is not rotated with the text so the label is not clickable. This creates an inconsistent user experience in the app when the user expects the label to be clickable, but on the charts where label rotation is necessary to make the text more legible, the expected behavior is missing. 

1 Reply

HM Hemalatha Marikumar Syncfusion Team December 2, 2019 10:43 AM UTC

Hi Dragan,

 

Greetings from Syncfusion.

 

We validated your query and were unable to reproduce the reported issue at our end. We suspected that touch was not recognized on the axis label due to its limited size when set the LabelRotationAngle. However, with the help of the ChartAxis’s LabelStyle’s Margin properties, you can resolve this issue as per the code snippet below.

  

Code Snippet [C#]:

 

CategoryAxis primaryAxis = new CategoryAxis();

primaryAxis.LabelClicked += PrimaryAxis_LabelClicked;

primaryAxis.LabelRotationAngle = 45;

primaryAxis.LabelStyle.MarginBottom = 8;

primaryAxis.LabelStyle.MarginLeft = 8;

primaryAxis.LabelStyle.MarginTop = 8;

primaryAxis.LabelStyle.MarginRight = 8;

chart1.PrimaryAxis = primaryAxis;

 

 

And we have prepared a sample based on your requirement and you can download the sample from the below link.

 

Samplehttps://www.syncfusion.com/downloads/support/forum/149572/ze/149572_AxisLabelClicked-1693113970.zip

 

Please refer below UG link to know more about axis label customization.

 

https://help.syncfusion.com/xamarin-android/sfchart/axis#label-customization

 

Please let us know if need any further assistance.

 

Regards,

Hemalatha M.


Loader.
Live Chat Icon For mobile
Up arrow icon