This is a migrated thread and some comments may be shown as answers.

AxisX Item Label Large Font Size with Rotation Causes Clipping

2 Answers 47 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 08 Mar 2012, 06:27 PM
My AxisX value is a Date.  I increased the Font Size of the AxisX Item Label and rotated it by -40 degrees and this is causing the first part of each label to be clipped (can not be seen).

How do I increase the height of the AxisX?  Alternatively, can this be accomplished through padding so that the Height needed would not need to be known for the Font Size to change?

Please see attached for example.

-Aaron Hoffman

2 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 13 Mar 2012, 10:15 AM
Hi Aaron,

Generally the ChartArea resizes accordingly when longer X-Axis labels are to be displayed or when the font size is larger, so the effect would be that the ChartArea itself is being shrinked. It seems like this does not happen in your case, so perhaps we are missing some of the details of your specific scenario. Could you, please, open a support ticket and send us a small sample application, which reproduces the issue you've encountered, so that we could have a look at your code and provide a solution.

Kind regards,
Nikolay
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Aaron
Top achievements
Rank 1
answered on 30 Mar 2012, 03:13 PM
I opened a support ticket and the resolution was to set the Margin in the Style as well, in addition to the rotation and FontSize.

<Style x:Key="AxisItemLabelDateOffset" TargetType="TextBlock">
	<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
	<Setter Property="RenderTransform">
		<Setter.Value>
			<CompositeTransform TranslateX="-30" TranslateY="14" Rotation="-45"/>
		</Setter.Value>
	</Setter>
	<Setter Property="FontSize" Value="12"></Setter>
	<Setter Property="Margin" Value="20,6,0,32"></Setter>
</Style>


Note: This solution can still allow the AxisX Item Label to be clipped on the extreme ends of the AxisX, if it goes out to the left past the AxisY.
Tags
Chart
Asked by
Aaron
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Aaron
Top achievements
Rank 1
Share this question
or