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

Chart wont draw CartesianCustomAnnotation of Horizontal/Vertical is outside of axes range

2 Answers 97 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 2
Iron
Iron
Veteran
Joe asked on 24 Apr 2020, 05:39 PM

My chart draws a CartesianCustomAnnotation showing an ellipse that is meant to skirt up the curve in my profile line  I bind the annotation's HorizontalValue and VerticalValue properties to the center point of the ellipse.   I've attached an image to show what it looks like.  

The problem is that if my profile curve is gradual, the ellipse gets so big that it the center point is actually outside of the chart axis Minimum/Maximum values.   As soon my annotation's HorizontalValue or VerticalValue is outside the boundaries, the chart stops drawing it at all.  Even if its radius means that it *would*, in fact show up in part on the display (which is what I want).

Is there a way to force the chart to draw my annotation regardless of where its origin lies?

2 Answers, 1 is accepted

Sort by
0
Joe
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 26 Apr 2020, 06:48 PM
I tried to work around this by using a BubbleSeries to draw the ellipse instead of a CartesianCustomAnnotation. 

Unfortunately that means I need a CustomScatterSeriesDescriptor object.  But it's not available.  I'm using the NuGet packages you distribute and it's just no there in the Telerik.Windows.Control.Chart.for.Wpf.Xaml (2020.1.218) package

I am using ScatterSeriesDescriptor in the exact same XAML file with no problems.  But CustomScatterSeriesDescriptor is not there.

So I'm really at a standstill here
0
Martin Ivanov
Telerik team
answered on 29 Apr 2020, 02:44 PM

Hello Joe,

The CustomScatterSeriesDescriptor class is part of the Telerik.Windows.Controls.Spreadsheet assembly. This is why you don't find it when referencing the Telerik.Windows.Controls.Chart nuget package. The class is used with the charts feature of the RadSpreadsheet control, which uses RadChartView internally.

To achieve your requirement you can create your own custom descriptor with a custom class that derives from the ScatterSeriesDescriptor class and override its  CreateInstanceCore method. Or alternatively, you can use the base ChartSeriesDescriptor as shown in the help documentation instead of creating a custom descriptor. 

About the annotation not rendering, this happens because of the built-in UI virtualization of the chart and the fact that the chart doesn't know much about the size of the elements in the ContentTemplate of the custom annotation. There is no API that allows forcing the chart to draw elements outside of the viewport. To acheive your requirement give the approach with the bubble series a try. 

Regards,
Martin Ivanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
ChartView
Asked by
Joe
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Joe
Top achievements
Rank 2
Iron
Iron
Veteran
Martin Ivanov
Telerik team
Share this question
or