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

About CharColumn and texts of Chart

Hello
2 questions:
1 - as I can change the orientation of the text of the x-axis?
2. How can I get the text value of the bar outside or inside the bar depending on the length of the bar and the text?. If can't, how to get the text out of the bar?

Thanks

Attachment: ChartBar_c63bbdb7.rar

3 Replies

AT Anandaraj T Syncfusion Team March 6, 2014 06:27 AM UTC

Hi Jesus Sanchez,

Thanks for using Syncfusion products.

Query #1: as I can change the orientation of the text of the x-axis?

We can achieve this by rotating axis labels. Please refer the following code snippet.

<code>
[CS]
           //Rotating axis labels
            chartmodel.PrimaryXAxis.LabelRotate = true;
            chartmodel.PrimaryXAxis.LabelRotateAngle = 270;
</code>

Query #2:
How can I get the text value of the bar outside or inside the bar depending on the length of the bar and the text?. If can't, how to get the text out of the bar?

If your intention is to display text without getting cut, we suggest you to set "TextOrientation" property of series style to "Smart".

Please refer the following code snippet to achieve this.
<code>
[CS]
           //Displaying series text
            series.Style.DisplayText = true;
            series.Style.Font.Orientation = 270;
            series.Style.TextOrientation = ChartTextOrientation.Smart;
</code>

For your convenience, we have created a simple sample based on your requirements and it can be downloaded from the following link.
TextOrientationMvc.zip

Please let us know if you have any concern.

Regards,
Anand


JS Jesus Sanchez March 6, 2014 04:31 PM UTC

Perfect!!!!

Thanks!!!!



AT Anandaraj T Syncfusion Team March 19, 2014 05:23 AM UTC

Hi Jesus Sanchez,

Thanks for the update. Please let us know if you have any other queries.

Regards,
Anand

Loader.
Live Chat Icon For mobile
Up arrow icon