Placing an annotation below a series.

Hi,

I would like to place an annotation below a series in a chart. Setting the Canvas.ZIndex of the annotation in concert with that of the series seems to have no effect. I suppose I could implement the annotation (a HorizontalLineAnnotation in this case) with a new series and arrange them that way, but am hoping a nicer solution is possible. Any suggestions?

Thanks

Tim Rawlinson

1 Reply

DA Devi Aruna Maharasi Murugan Syncfusion Team September 14, 2016 07:37 AM UTC

Hi Tim, 
  
Thanks for contacting Syncfusion Support. 
  
We can achieve your requirement by overriding the OnApplyTemplate in SfChart class. Please find the code snippet below, 
  
 
protected override  void OnApplyTemplate() 
   { 
      // Canvas.ZIndexProperty is set to SeriesAnnotationCanvas 
      (GetTemplateChild("Part_SeriesAnnotationCanvas") as     
                               Canvas).SetValue(Canvas.ZIndexProperty, -1); 
       base.OnApplyTemplate(); 
    } 
  
We have prepared a demo sample for your reference and it can be downloaded from below link, 
  
  
Regards, 
Devi 


Loader.
Up arrow icon