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

Cannot get the x-axis lables to line up properly

3 Answers 57 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Iron
Andy asked on 04 Oct 2011, 06:50 PM

Charts are bound to a class.  2 doubles and 1 date.  The doubles are the y-axis series and the date is the x-axis

See the attached file for how it looks. LayoutMode is set to inside which moves the points but not the label.

Here is the code for the 1st chart:

<div class="chartleft">
     
   <telerik:RadChart ID="RadChart1" runat="server" DefaultType="Line" ChartTitle-TextBlock-Text="Last 10 Updates" Width="525">
      <PlotArea>
         <Appearance Dimensions-Margins="18%, 30%, 25%, 10%">
         </Appearance>
         <EmptySeriesMessage Visible="True">
            <Appearance Visible="True">
            </Appearance>
         </EmptySeriesMessage>
          <YAxis IsZeroBased="false">
          </YAxis>
          <XAxis LayoutMode="Inside" AutoScale="false" LabelStep="1" DataLabelsColumn="date" >
              <Appearance ValueFormat="ShortDate" MajorGridLines-Visible="false" >
                  <LabelAppearance RotationAngle="45" Position-AlignedPosition="Top">
                  </LabelAppearance>
              </Appearance>
          </XAxis>
      </PlotArea>
        
      <Series>
          <telerik:ChartSeries DataYColumn="realvalues" Name="Real Values" Type="Line">
          </telerik:ChartSeries>
          <telerik:ChartSeries DataYColumn="othervalues" Name="Trending Values" Type="Line">
          </telerik:ChartSeries>
      </Series>
        
   </telerik:RadChart>
</div>

here is the class it is bound to:

public class chartdata
   {
   public double realvalues { get; set; }
   public double othervalues { get; set; }
   public double date { get; set; }
   public chartdata(double r, double o, DateTime dt)
      {
      date = dt.ToOADate();
      realvalues = r;
      othervalues = o;
      }
   }


 

 

 

 



3 Answers, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 05 Oct 2011, 01:01 PM
Hello Andy,

Since you have rotated the Axis Labels - they look as they are not affected by the LayoutMode property. The Rotation mechanism uses the middle of the Label's Length as starting point. If you set the Rotation angle to 90 for example you should be able to see that the LayoutMode is visibly set.

Regards,
Evgenia
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Andy
Top achievements
Rank 1
Iron
answered on 05 Oct 2011, 07:24 PM
You are correct... the 90 degree rotation made them line up.

The 45 rotation looks so much better... any options to be able to shift them over another way?

Andy
0
Evgenia
Telerik team
answered on 10 Oct 2011, 09:30 AM
Hello Andy,

You may keep the RotationAngle to 45 degrees as you wished and set the Left Margin of the AxisX Items to 0 which will cause the labels to shift left. Here is how you can access the Margins - PlotArea-> XAxis -> Appearance -> LabelAppearance -> Dimensions-Margins.

Kind regards,
Evgenia
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Chart (Obsolete)
Asked by
Andy
Top achievements
Rank 1
Iron
Answers by
Evgenia
Telerik team
Andy
Top achievements
Rank 1
Iron
Share this question
or