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.
Unfortunately, activation email could not send to your email. Please try again.

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

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

Article ID: Published Date: Last Revised Date: Platform: Control:
5123 06/03/2015 06/03/2015 Windows Phone SfChart
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.