Y Axis Texblock alignment

Thread is closed for posting
2 posts, 0 answers
  1. Simon
    Simon avatar
    7 posts
    Member since:
    Aug 2008

    Posted 28 Aug 2008 Link to this post

    Hi there,

    I want to ident my textblocks for the Y axis by tabs. That means I want to have a structure from the left side. It looks like followed:

    Part 1
        Part 1.1
        Part 1.2

    But this is not possible by crating textblocks and set the aligned position:
    yAxis[0].TextBlock.Text = "Part 1";  
    yAxis[0].TextBlock.Appearance.Position.AlignedPosition = AlignedPositions.Left;  
     
    yAxis[1].TextBlock.Text = "\tPart 1.1";  
    yAxis[1].TextBlock.Appearance.Position.AlignedPosition = AlignedPositions.Left;  
     
    yAxis[2].TextBlock.Text = "\tPart 1.1";  
    yAxis[2].TextBlock.Appearance.Position.AlignedPosition = AlignedPositions.Left; 
    It causes an ident between axis line and text and not between chart border and text.

    How could I solve my problem?

    Thanks Simon
  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 01 Sep 2008 Link to this post

    Hello Simon,

    We would suggest you to set custom size for the textblock and then customize the text alignment as appropriate like this:

    <telerik:RadChart ID="RadChart1" runat="Server" AutoLayout="true"
        <Series> 
            <telerik:ChartSeries> 
                <Items> 
                    <telerik:ChartSeriesItem YValue="10"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem YValue="20"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem YValue="30"
                    </telerik:ChartSeriesItem> 
                </Items> 
            </telerik:ChartSeries> 
        </Series> 
        <PlotArea> 
            <YAxis AutoScale="false" MinValue="0" MaxValue="30" Step="10"
                <Items> 
                    <telerik:ChartAxisItem Value="0"
                    </telerik:ChartAxisItem> 
                    <telerik:ChartAxisItem Value="10"
                        <TextBlock Text="Text1"
                            <Appearance Dimensions-AutoSize="false" Dimensions-Height="20" Dimensions-Width="70" 
                                Position-AlignedPosition="Right"
                            </Appearance> 
                        </TextBlock> 
                    </telerik:ChartAxisItem> 
                    <telerik:ChartAxisItem Value="20"
                        <TextBlock Text="Text2"
                            <Appearance Dimensions-AutoSize="false" Dimensions-Height="20" Dimensions-Width="70" 
                                Position-AlignedPosition="Right"
                            </Appearance> 
                        </TextBlock> 
                    </telerik:ChartAxisItem> 
                    <telerik:ChartAxisItem Value="30"
                        <TextBlock Text="Text3"
                            <Appearance Dimensions-AutoSize="false" Dimensions-Height="20" Dimensions-Width="70" 
                                Position-AlignedPosition="Left"
                            </Appearance> 
                        </TextBlock> 
                    </telerik:ChartAxisItem> 
                </Items> 
            </YAxis> 
        </PlotArea> 
    </telerik:RadChart> 


    Hope this helps.


    Sincerely yours,
    Manuel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top