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

Align labels on vertical axis to left

4 Answers 142 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Oleg
Top achievements
Rank 1
Oleg asked on 04 Sep 2013, 10:51 AM
Now chart aligns this label to center:
      123123123 | ======
                  232 |====
              12322 | ========

I want to customize it to:
            123123 |=====   
            12         |===
            43455   |=======

What exacty template should i customize?
Here is code:
<telerikChart:RadCartesianChart >
    <telerikChart:RadCartesianChart.HorizontalAxis >
        <telerikChart:LinearAxis ShowLabels="False" />
    </telerikChart:RadCartesianChart.HorizontalAxis>
    <telerikChart:RadCartesianChart.VerticalAxis>
        <telerikChart:CategoricalAxis/>
    </telerikChart:RadCartesianChart.VerticalAxis>
    <telerikChart:BarSeries ShowLabels="True">
      <charting:CategoricalDataPoint Value="400000" Category="asdasda2" Label="12313 usd"/>
    </telerikChart:BarSeries>
</telerikChart:RadCartesianChart>
     

4 Answers, 1 is accepted

Sort by
0
Oleg
Top achievements
Rank 1
answered on 05 Sep 2013, 10:46 AM
I hound these similar topic and updated my code:
<telerikChart:RadCartesianChart.VerticalAxis>
    <telerikChart:CategoricalAxis>
        <telerikChart:CategoricalAxis.LabelStyle>
            <Style TargetType="TextBlock">
                <Setter Property="HorizontalAlignment" Value="Left" />
            </Style>
        </telerikChart:CategoricalAxis.LabelStyle>
    </telerikChart:CategoricalAxis>
</telerikChart:RadCartesianChart.VerticalAxis>
But it also does not work
0
Deyan
Telerik team
answered on 09 Sep 2013, 11:15 AM
Hello Oleg,

Can you try setting the TextAlignment property for the TextBlock instead of HorizontalAlignment?

Regards,
Deyan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Oleg
Top achievements
Rank 1
answered on 09 Sep 2013, 11:50 AM
Hi Deyan, unfortunately it does not work for me
<telerikChart:RadCartesianChart Name="BarChart">
    <telerikChart:RadCartesianChart.HorizontalAxis>
        <telerikChart:LinearAxis ShowLabels="False" />
    </telerikChart:RadCartesianChart.HorizontalAxis>
    <telerikChart:RadCartesianChart.VerticalAxis >
        <telerikChart:CategoricalAxis>
            <telerikChart:CategoricalAxis.LabelStyle>
                <Style TargetType="TextBlock">
                    <Setter Property="TextAlignment" Value="Left" />
                </Style>
            </telerikChart:CategoricalAxis.LabelStyle>
        </telerikChart:CategoricalAxis>
    </telerikChart:RadCartesianChart.VerticalAxis>
</telerikChart:RadCartesianChart>
0
Deyan
Telerik team
answered on 12 Sep 2013, 12:07 PM
Hi Oleg,

Thanks for writing back.

You will have to explicitly set Width to the text blocks in order for the TextAlignment property to work. Otherwise the alignment will not work since the text blocks are measured and arranged according to their desired size.

I hope this helps.

Regards,
Deyan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Chart
Asked by
Oleg
Top achievements
Rank 1
Answers by
Oleg
Top achievements
Rank 1
Deyan
Telerik team
Share this question
or