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

PolarSeries Closed Line

5 Answers 11 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 19 Feb 2015, 12:12 PM
Hi, 

When creating my polar charts I sometimes need them to be open ended (if say I only have 180 degrees of data). Currently when I plot them they automatically close (image attached). Is there an "IsClosed" property for the series? I'm using the ChartSeriesProvider.

Thanks,

James

5 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 20 Feb 2015, 02:39 PM
Hello James,

Yes, the PolarLineSeries and the PolarAreaSeries expose IsClosed property that determines whether the line curve will be closed. The default value of this property is True. However, as this property is not a DependencyProperty it can't be set in Style. To resolve this you can create an attached property and use it to set the IsClosed property in the Style of the series descriptor.

Here is an example:
<telerik:PolarSeriesDescriptor.Style>
    <Style TargetType="telerik:PolarLineSeries">
        <Setter Property="local:PolarChartUtilities.IsSeriesClosed" Value="False" />                                   
    </Style>
</telerik:PolarSeriesDescriptor.Style>

public class PolarChartUtilities
{
    public static bool GetIsSeriesClosed(DependencyObject obj)
    {
        return (bool)obj.GetValue(IsSeriesClosedProperty);
    }
 
    public static void SetIsSeriesClosed(DependencyObject obj, bool value)
    {
        obj.SetValue(IsSeriesClosedProperty, value);
    }
 
    public static readonly DependencyProperty IsSeriesClosedProperty =
        DependencyProperty.RegisterAttached("IsSeriesClosed", typeof(bool), typeof(PolarChartUtilities), new PropertyMetadata(true, OnIsSeriesClosedChanged));
 
    private static void OnIsSeriesClosedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
    {
        if (e.NewValue == null) { return; }
        var series = (PolarLineSeries)d;
        series.IsClosed = (bool)e.NewValue;
    }
}

Please try this approach and let me know if it works for you.

Regards,
Martin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
James
Top achievements
Rank 1
answered on 23 Feb 2015, 12:02 PM
Thanks Martin that works for me!
0
Marcello
Top achievements
Rank 1
answered on 18 Oct 2016, 10:27 AM

Hi,

 

exists a similar strategy in Windows Forms version?

thanks.

0
Martin Ivanov
Telerik team
answered on 18 Oct 2016, 11:16 AM
Hi Marcello,

Can you post your question in the WinForms section of the forums? This way more people from the WinForms community could see your question and the chance to get a suitable answer increases. Thank you for the cooperation.

Regards,
Martin
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Marcello
Top achievements
Rank 1
answered on 18 Oct 2016, 11:21 AM
Moved, thanks
Tags
ChartView
Asked by
James
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
James
Top achievements
Rank 1
Marcello
Top achievements
Rank 1
Share this question
or