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

X-Axis

1 Answer 126 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Agyeman
Top achievements
Rank 1
Agyeman asked on 19 May 2008, 11:51 PM
Please could someone tell me or direct me to an example of how can I customize my x-axis values. i want to place custom string  names as xAxis values. thank yopu.

1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 20 May 2008, 08:14 AM
Hi Agyeman,

You need to set XAxis.AutoScale property to false and then you can customize the axis item labels like this:

<telerik:RadChart ID="RadChart1" runat="server" AutoLayout="True"
    <Series> 
        <telerik:ChartSeries Name="Series 1" Type="Line"
            <Items> 
                <telerik:ChartSeriesItem Name="Item 1" YValue="5"
                </telerik:ChartSeriesItem> 
                <telerik:ChartSeriesItem Name="Item 2" YValue="1"
                </telerik:ChartSeriesItem> 
                <telerik:ChartSeriesItem Name="Item 3" YValue="2"
                </telerik:ChartSeriesItem> 
                <telerik:ChartSeriesItem Name="Item 4" YValue="9"
                </telerik:ChartSeriesItem> 
                <telerik:ChartSeriesItem Name="Item 5" YValue="5"
                </telerik:ChartSeriesItem> 
            </Items> 
        </telerik:ChartSeries> 
    </Series> 
    <PlotArea> 
        <XAxis AutoScale="false" MinValue="1" MaxValue="5" Step="1"
            <Items> 
                <telerik:ChartAxisItem Value="1"
                    <TextBlock Text="Custom1"></TextBlock> 
                </telerik:ChartAxisItem> 
                <telerik:ChartAxisItem Value="2"
                    <TextBlock Text="Custom2"></TextBlock> 
                </telerik:ChartAxisItem> 
                <telerik:ChartAxisItem Value="3"
                    <TextBlock Text="Custom3"></TextBlock> 
                </telerik:ChartAxisItem> 
                <telerik:ChartAxisItem Value="4"
                    <TextBlock Text="Custom4"></TextBlock> 
                </telerik:ChartAxisItem> 
                <telerik:ChartAxisItem Value="5"
                    <TextBlock Text="Custom5"></TextBlock> 
                </telerik:ChartAxisItem> 
            </Items> 
        </XAxis> 
    </PlotArea> 
</telerik:RadChart> 


Hope this helps.


Regards,
Manuel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Chart (Obsolete)
Asked by
Agyeman
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or