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

Vertical X-Axis Labels & Spacing

2 Answers 236 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Ty
Top achievements
Rank 1
Ty asked on 11 May 2009, 07:39 PM
The spacing between labels works just fine when labels are horizontal, but when I rotate x-axis labels by 90 degrees they appear irregularly spaced from each other.  It appears the length of text in the label affects the spacing (example) between labels.

Is there a way to make the labels equidistant apart as they are with AutoScale enabled, but still display these ShortDateTimeStrings?

Here's the markup for a chart:
<rad:RadChart ID="Chart1" runat="server" Height="450" Width="850" IntelligentLabelsEnabled="false" AutoLayout="true"
                <Legend Visible="false" /> 
                <PlotArea> 
                    <Appearance Dimensions-Margins="10,20,90,50" FillStyle-MainColor="White" FillStyle-FillType="Solid" Border-Visible="false" /> 
                </PlotArea> 
                <ChartTitle TextBlock-Text="Active POs by Client" Visible="false" /> 
                <Appearance Dimensions-Height="450" Dimensions-Width="850" FillStyle-MainColor="White" Border-Visible="false" /> 
            </rad:RadChart> 


And the function that this chart is passed to:
private void PopulateChart( RadChart chart, string queryName, int clientID ) 
        { 
            Font calibri = new Font( "Calibri", 9 ); 
 
            ChartSeries series = new ChartSeries( string.Empty, ChartSeriesType.Area ); 
 
            series.Appearance.TextAppearance.TextProperties.Font = calibri; 
            chart.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Font = calibri; 
            chart.PlotArea.YAxis.Appearance.TextAppearance.TextProperties.Font = calibri; 
 
            chart.AddChartSeries( series ); 
            chart.PlotArea.XAxis.Clear( ); 
            chart.PlotArea.XAxis.AutoScale = false
            chart.PlotArea.XAxis.LayoutMode = ChartAxisLayoutMode.Normal; 
            chart.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 90; 
            chart.PlotArea.XAxis.Items.Clear( ); 
            chart.Series[0].Items.Clear( ); 
 
            foreach ( KeyValuePair<DateTime, int> item in GetData( clientID, queryName ) ) 
            { 
                chart.PlotArea.XAxis.AddItem( item.Key.ToShortDateString( ) ); 
                string label = item.Value.ToString( "N0" ); 
 
                ChartSeriesItem i = new ChartSeriesItem( item.Value, label ); 
                chart.Series[0].AddItem( i ); 
            } 
        } 

2 Answers, 1 is accepted

Sort by
0
Dessy
Telerik team
answered on 12 May 2009, 04:47 PM

Hi ,

We were unable to reproduce the problem on our side. We created a test page using your code and changing only data values. RadChart generated from this code, is displaying its labels properly arranged in equal distance. 
You can check the attached sample page, illustrating this. The resulting chart seems to be fine with both RadChart for ASP.NET and RadChart for ASP.NET AJAX version.
Please, make sure you use the latest version of the control. We would recommend you to use the latest versions of our products, so you are able to take advantage of the new features and bugfixes.

Regards,

Dessy
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ty
Top achievements
Rank 1
answered on 12 May 2009, 07:17 PM
Thank you for your help.
Tags
Chart (Obsolete)
Asked by
Ty
Top achievements
Rank 1
Answers by
Dessy
Telerik team
Ty
Top achievements
Rank 1
Share this question
or