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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How can you modify axis text elements without disturbing the axis labels?

Platform: Windows Phone |
Control: SfChart |
Published Date: June 3, 2015 |
Last Revised Date: June 3, 2015

Description:

When the font formatting properties of the axis is personalized all the text elements of the axis get personalized. So this article describes the way to personalize the axis labels alone.

Solution:

The font formatting properties of the axis affects all the text elements related to the axis. Hence to customize the axis labels or any other text element that you want, custom templates can be assigned to the text element’s template property. Thus the desired text element alone can be customized.

The LabelTemplate property of the axis is used to customize the axis labels.

Note: The font formatting properties of the LabelTemplate i.e., font formatting properties in the TextBlock of the DataTemplate, must be overridden. If not the formatting properties of the axis TextElement are assigned to the labels of the axis, that is, if the FontSize 23 is not assigned in the LabelTemplate, the axis labels take the FontSize 30 from the TextElement.FontSize property of the axis.

XAML

C#

C#

Output:

The following screenshot illustrates the output for the axis labels whose font formatting remains undisturbed.

F:\Issue Files Chart\Issue File -10 Knowledge Base\WP_ScreenShot\New Second TIme\wp_ss_20150210_0042.png

Figure 1: Chart with axis label style applied

ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon