RadPolarChart PolarLineSeries overflow when axis reduced

5 Answers 108 Views
Chart
Thomas
Top achievements
Rank 1
Iron
Iron
Iron
Thomas asked on 12 Jul 2021, 02:43 PM

Hello,

I'm using Telerik WPF R1 2021

We discovered that PolarLineSeries are not correctly displayed when we have a PolarAxis that is too strict for the data to display.

We work a lot with graph and happen to dynamically (or from user input) resize the axis for readability

 

For example, I have a dataset in spiral


<telerik:PolarDataPoint Angle="0" Value="0"/> 
<telerik:PolarDataPoint Angle="30" Value="1"/> 
<telerik:PolarDataPoint Angle="60" Value="2"/> 
<telerik:PolarDataPoint Angle="90" Value="3"/> 
<telerik:PolarDataPoint Angle="120" Value="4"/> 
<telerik:PolarDataPoint Angle="150" Value="5"/> 
<telerik:PolarDataPoint Angle="180" Value="6"/> 
<telerik:PolarDataPoint Angle="210" Value="7"/> 
<telerik:PolarDataPoint Angle="240" Value="8"/> 
<telerik:PolarDataPoint Angle="270" Value="9"/> 
<telerik:PolarDataPoint Angle="300" Value="10"/> 
<telerik:PolarDataPoint Angle="330" Value="11"/> 

If I reduce the PolarAxis to display between 3 and 8, overflow points will be displayed outside the graph and other point will be displayed according to the difference between minvalue and the actual value of the point

 

Here a screenshot of my test projet attached

Is that normal or did I miss something to do that ?

Right now, we override the PolarLineSerie to udpate the source according to the actual min and max value of the axis

You can find my project attached to this post

 

Regards

Thomas

5 Answers, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 20 Jul 2021, 10:47 AM

Hello Thomas,

On a second scan of the data and the visualization, I can agree that the visualization is not exactly expected. The data points that are below the minimum of the axis are drawn at the correct polar values, but the radial angles are reversed. This happens because of the geometry calculation algorithm of the line which is not designed to work for this scenario. In general, the chart doesn't implement any data filtering or visualization correction for data outside of the plot area. The filtering on the end user side will be more convenient when it comes to performance and memory footprint compared to implementing it inside the source code of the chart. This is why the chart doesn't implement this feature. As for the data outside of the plot area, all charts in the ChartView suite are drawing this, but for the CartesianChart is bit easier to clip those using the PlotToClipArea property.

With the polar chart, the ClipToPlotArea property doesn't affect the ellipse form of the chart, but the rectangular bounds (of the RadPolarChart control), which expand with a certain padding around the ellipse (because of the . This is why it doesn't clip the line within the ellipse. Also, this won't help with the line part that is inside the ellipse. This is why the filtering is the most convenient point that I can suggest at this point.

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Martin Ivanov
Telerik team
answered on 15 Jul 2021, 10:47 AM

Hello Thomas,

The reported behavior it is expected and it appears because the chart doesn't automatically filters its data. Everything you plot on the chart will be drawn. If it goes outside of the chart it will get clipped. Currently, you can control whether to clip the series visualization or not via the ClipToPlotArea property. However, this is a rectangular clip that matches the chart's size which is bigger than the circle representing the radial axis. 

To achieve your requirement, you can filter your data as you are doing in the last chart. Basically, you can remove the data points outside of the polar axis' range.

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Thomas
Top achievements
Rank 1
Iron
Iron
Iron
answered on 15 Jul 2021, 12:53 PM

Hello,

Thanks for your answer, I already used the ClipToPlotArea to true but maybe I didn't set correctly the size of the area that's why we can see overflow data I will check that.

But from my point of the view, the behavior you said "expected" cannot be correct as the data displayed are definitely wrong when the data under the min value of the axis does something totally unexpected.

At least I would think all data point under the min value of the axis would stack on the origin of the graph and it would be okay, but the behavior right now doesn't display correctly those points

 

As you said we figured out a way to filter those data, but it's quite bothersome to link all needed information in the serie to do that instead of your side where you actually display those data.

Also I don't see why we can change the axis on other graph without having those problems but on PolarChart we have to do it by ourself

 

Regards,

Thomas

0
Thomas
Top achievements
Rank 1
Iron
Iron
Iron
answered on 15 Jul 2021, 01:08 PM

Sorry for double post but I just tried the ClipToPlotArea but it doesn't work as you said it would

In red this is the border we can set as PlotArea (I just added a border color to my previous test project), my PolarLineSeries has ClipToPlotArea to True and overflow data are still visible... (I tried "false" too)

 

Regards

Thomas

0
Thomas
Top achievements
Rank 1
Iron
Iron
Iron
answered on 22 Jul 2021, 09:27 AM

Ok

Thank you for the more elaborate answer ;)

Indeed, we will keep filtering the data, I just wanted to know if this behavior is a bug or not and let you know if you need to fix or not

 

Thank you

Regards,

Thomas

Tags
Chart
Asked by
Thomas
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Martin Ivanov
Telerik team
Thomas
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or