Hi, I am using telerik:RadCartesianChart in my UI. But I can't control the alignment of the vertical labels.
My code looks like this:
================================================================================================
<Style x:Key="BarLabelTextStyle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="HorizontalAlignment" Value="Center"></Setter>
<Setter Property="Width" Value="40"></Setter>
</Style>
<telerik:RadCartesianChart x:Name="BarChart" Grid.Row="1"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch">
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:CategoricalAxis GapLength="0.4"
LabelFitMode="Rotate"
ShowLabels="True"
SmartLabelsMode="SmartStep"
LabelStyle="{StaticResource BarLabelTextStyle}"
PlotMode="OnTicksPadded" />
</telerik:RadCartesianChart.HorizontalAxis>
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis Maximum="{Binding MaxCount}"
Minimum="{Binding MinCount}"
ShowLabels="True"
LabelStyle="{StaticResource BarLabelTextStyle}" />
</telerik:RadCartesianChart.VerticalAxis>
<telerik:RadCartesianChart.Grid>
<telerik:CartesianChartGrid MajorLinesVisibility="Y" />
</telerik:RadCartesianChart.Grid>
<telerik:BarSeries CategoryBinding="Name"
ValueBinding="Proportion"
ItemsSource="{Binding CheckedListItems}"
ShowLabels="{Binding LabelEnabled}"
CombineMode="Cluster"
IsHitTestVisible="True">
<telerik:BarSeries.PointTemplate>
<DataTemplate>
<Border
Background="{Binding DataItem, Converter={StaticResource SliceToBarBrushConverter}}"
MouseEnter="BarElement_MouseEnter"
MouseLeave="BarElement_MouseLeave" />
</DataTemplate>
</telerik:BarSeries.PointTemplate>
</telerik:BarSeries>
<telerik:RadCartesianChart.Behaviors>
<telerik:ChartTrackBallBehavior />
<telerik:ChartPanAndZoomBehavior x:Name="ZoomPanBehavior" ZoomMode="None" PanMode="None"
DragMode="Pan" />
<telerik:ChartSelectionBehavior DataPointSelectionMode="Multiple" HitTestMargin="2"
SelectionChanged="BarChartSelectionBehavior_SelectionChanged" />
</telerik:RadCartesianChart.Behaviors>
</telerik:RadCartesianChart>
================================================================================================
Changing the BarLabelTextStyle HorizontalAlignment is not affecting anything for bar labels.
The result looks like from attachment. You can see that the first bar chart's vertical labels are too far away from axis. And the second bar chart's labels are too close to the first bar chart, comparing to it's own axis.
Is there something I can do here?
Thanks.