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

3 posts, 0 answers
  1. Joe
    Joe avatar
    85 posts
    Member since:
    Nov 2017

    Posted 24 Apr Link to this post

    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. Joe
    Joe avatar
    85 posts
    Member since:
    Nov 2017

    Posted 26 Apr in reply to Joe Link to this post

    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
  3. Martin Ivanov
    Martin Ivanov avatar
    2444 posts

    Posted 29 Apr Link to this post

    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. 

    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.
Back to Top