Align labels on vertical axis to left

5 posts, 0 answers
  1. Oleg
    Oleg avatar
    10 posts
    Member since:
    Aug 2012

    Posted 04 Sep 2013 Link to this post

    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>
         
  2. Oleg
    Oleg avatar
    10 posts
    Member since:
    Aug 2012

    Posted 05 Sep 2013 Link to this post

    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
  3. DevCraft banner
  4. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 09 Sep 2013 Link to this post

    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 >>
  5. Oleg
    Oleg avatar
    10 posts
    Member since:
    Aug 2012

    Posted 09 Sep 2013 Link to this post

    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>
  6. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 12 Sep 2013 Link to this post

    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 >>
Back to Top
DevCraft banner