Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
645
Custom series markers in legend
posted

My xamDataChart displays a number of ScatterSeries and I build a set of custom markers to display on my xamDataChart and would like to get those to show up in the legend.  To get the custom markers to show up I essentially created the marker points (e.g., for a square I might do "0,0 1,0 1,1 0,1") and created a polygon template like so:

 

<DataTemplate x:Key="polygonTemplate">

   <Polygon Stretch="Fill" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"

      Fill="{Binding ActualItemBrush}" Points = "{Binding Item.Points}" Stroke="{Binding Series.ActualMarkerOutline}"

      MinWidth="10" MinHeight="10" RenderTransform="{Binding Item.RenderTransform}"/>

</DataTemplate>

In the code behind, I build my scatter series.

This works pretty well but my legend doesn't display the polygon badge (I think that's what it is called).  

If I create instead an ellipseTemplate which uses an Ellipse, it'll draw pretty well (since I didn't have to bind it to something to get the points that make up the shape. For now, this is what I'm using but I'd like to display my own shapes (rather than an ellipse or the stock shapes).

How would you get the series shape to show up for these custom polygons?

Thanks,

Matt

Parents Reply Children
No Data