Polar Chart, labeled degrees

2 posts, 0 answers
  1. Mark
    Mark avatar
    5 posts
    Member since:
    Sep 2010

    Posted 04 Feb Link to this post

    I need to make a polar chart that is not labeled 0 to360 but 0 to 180 and 0 to -150.  Any ideas on how I might do this?

    I included an image of what I need in case it is not clear.

  2. Martin
    Martin avatar
    1101 posts

    Posted 08 Feb Link to this post

    Hi Mark,

    The polar chart doesn't support such behavior. In order to achieve the desired result you can use the following approach:
    • Use GenericDataPointBinding<T> for the AngleBinding of the series. In its ValueSelector you can convert the negative values to positive ones in the range between 181 and 359 degrees. For example, -60 should become 300 and -150 should be 210.
    • Use a LabelTemplate and an IValueConverter to display the labels with the negative values. Basically, if the value in the label is bigger then 180, make the calculations and return a negative value. An example:
                  <TextBlock Text="{Binding Converter={StaticResource angleConverter}}" />

      public class AngleConverter : IValueConverter
          public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
              var angle = (double)value;     
              return angle > 180 ?  -(360 - angle) : angle;
          public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
              throw new NotImplementedException();

    I hope this information is useful.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top