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

Polar Chart, labeled degrees

2 Answers 34 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 04 Feb 2016, 10:14 PM

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 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 08 Feb 2016, 02:25 PM
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:
    <telerik:NumericRadialAxis>
        <telerik:NumericRadialAxis.LabelTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding Converter={StaticResource angleConverter}}" />
            </DataTemplate>
        </telerik:NumericRadialAxis.LabelTemplate>
    </telerik:NumericRadialAxis>

    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.

Regards,
Martin
Telerik
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
0
Raji
Top achievements
Rank 1
Iron
answered on 17 Jun 2022, 06:06 AM

Hi Team,

I need to make a half-polar chart.  Any ideas on how I might do this?

Please find the attached document for your reference.

Thanks

Rajalakshmi.s

 
Martin Ivanov
Telerik team
commented on 21 Jun 2022, 01:15 PM

There is no Telerik control that allows this type of visualization. One way that you can achieve something similar is to use RadCartesianChart for the data and a custom chart annotation for the radar lines. However, note that with this approach you will need to draw and position the lines manually.
Tags
ChartView
Asked by
Mark
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Raji
Top achievements
Rank 1
Iron
Share this question
or