Label AlignedPosition in Bar Chart

4 posts, 0 answers
  1. Don Turkstra
    Don Turkstra avatar
    2 posts
    Member since:
    Nov 2005

    Posted 07 Jun 2007 Link to this post

    Hi,

    I have a WinForm bar chart where I want the labels to be rotated 90 degrees and positioned just above the x-axis.

    I can rotate the labels by setting:
    item.Label.TextBlock.Appearance.RotationAngle = 90

    I can't seem to get the labels positioned at the bottom of the bar instead of the top.

    I've tried:
    item.Label.TextBlock.Appearance.Position.AlignedPosition = AlignedPositions.Bottom, Top, Right, Left

    and it doesn't change the alignment.

    Could someone point me in the right direction?

    Thx

  2. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 08 Jun 2007 Link to this post

    Hello Don,

    To put the labels on the X axis, you should manage the whole series instead of the items:
     
    chartSeries1.Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Bottom; 
    chartSeries1.Appearance.LabelAppearance.RotationAngle = 90F; 
     

    You can do this through the Property grid as well.

     
    Kind regards,
    Evtim
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Don Turkstra
    Don Turkstra avatar
    2 posts
    Member since:
    Nov 2005

    Posted 08 Jun 2007 Link to this post

    Thanks for the reply... that helps.

    The problem that I have now is that some of the labels are being truncated.  For example

    chart.PlotArea.YAxis.Appearance.ValueFormat = ChartValueFormat.Currency;

    series.Appearance.LabelAppearance.RotationAngle = 90F;
    series.Appearance.LabelAppearance.Position.AlignedPosition = AlignedPositions.Center;

    2 series, both defined the same with 1 item each.
    series 1, the item has a y-value of 2500.
    series 2, the item has a y-value of 0.

    The $2,500.00 label shows correctly in the center of the bar
    The $0.00 displays as $0.0 (missing the last zero).

    Any ideas?

    Thanks again...

  5. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 11 Jun 2007 Link to this post

    Hello Don,

    Unfortunately, we couldn't reproduce the reported issue. Please, create a simple project exposing the incorrect behavior and send it us in a new support ticket. We will be happy to review it for you.

    You can also play with NumberFormatInfo to enforce 2 digits after the decimal point for the currency format.

     
    Regards,
    Evtim
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top