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

Distance between axis and Axis label

Thread ID:





101735 Nov 16,2011 04:58 PM UTC Nov 29,2011 05:19 AM UTC WPF 4
Tags: Chart
Asked On November 16, 2011 04:58 PM UTC


I was wondering if it was possible to control the distance between a chartAxis' line and it's labels. I find that by default the numbers are really close to the line and this sometimes causes overlap which is not very professional looking (see picture attached).

Any help is appreciated. Thanks.



Premanand [Syncfusion]
Replied On November 18, 2011 06:01 AM UTC

Hi James,

Thanks for your interest in Syncfusion Products.

We can acheive your requirement by using EdgeLabelsDrawingMode property to shift the label and also by using the LabelTemplate to set the margin for labels.

We have created a simple sample which resolves your problem, please download the sample from the below location,


In that sample, we can acheive your requirements by using EdgeLabelsDrawingMode and also using the Template for the Labels.

Please refer the follwing code snippet which will helps you,

Please refer to the code snippet of the LabelTemplate of ChartAxis which is set using StaticResource

Template for Primary Axis(X-Axis):

Template for Secondary Axis(Y-Axis):

Please let us know if you have any further clarifications.

Premanand M

Replied On November 18, 2011 04:40 PM UTC

The template idea seems to work to create spacing so that is good Thank you.

I was not able to run the sample because it references things (System.xaml) that are VS2010 only and I'm still using VS2008.

The issue that arises now is that I have lost the original fontsize of the axis labels.

I figure that I should set the binding of the Textblock's FontSize (in the datatemplate) property to something... Any idea on what this could be?

Replied On November 21, 2011 06:22 PM UTC

Here's how I did it:

Instead of setting the DataTemplate's content to a textbox like this:

Set it to a label:

In this way the original fontsizes, fontfamily, fontweight and a lot of other stuff are preserved and you get the margin you want between the axes and it's labels

Ganesan [Syncfusion]
Replied On November 29, 2011 05:19 AM UTC


Thanks for the update. Kindly let us know for any further assistance.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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