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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Distance between axis and Axis label

Thread ID:

Created:

Updated:

Platform:

Replies:

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

Hello,

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.

James



AxisLabelFail_3b52dc0b.zip

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,

http://www.syncfusion.com/downloads/Support/DirectTrac/86387/Sample1003291813.zip

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.

Regards,
Premanand M







James
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?


James
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

Hi,

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

Regards,
Ganesan


CONFIRMATION

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.

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

;