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

Y Axis Texblock alignment

1 Answer 43 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 28 Aug 2008, 09:53 AM
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

1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 01 Sep 2008, 08:42 AM
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.
Tags
Chart (Obsolete)
Asked by
Simon
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or