ScatterLineSeries currently has properties for conveniently setting the MarkerType, MarkerOutline, and MarkerBrush. There isn't a MarkerSize property, so how should you go about changing the marker size? Since it's apparently not as simple as setting a single property like for type, outline, or brush, can you please submit an enhancement request to add a MarkerSize property for ScatterLineSeries?
Thanks!
Hi dsvaughan,
I've submitted this issue for a MarkerSize property and it is currently being looked into for our 11.1 release. In the mean time, if you'd like to change the size of your makers on your ScatterLine series, you can change the CircleMarkerTemplate's MinWidth and MinHeight properties to achieve this. Here's what I did:
CircleMarkerTemplate in my Window.Resources
<DataTemplate x:Key="CircleMarkerTemplate"> <Ellipse Stretch="Fill" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Fill="{Binding ActualItemBrush}" Stroke="{Binding Series.ActualMarkerOutline}" StrokeThickness="0.5" MinWidth="35" MinHeight="35"/> </DataTemplate>
I then assigned this template to the CircleMarkerTemplate property of my XamDataChart:
<igChart:XamDataChart CircleMarkerTemplate="{StaticResource CircleMarkerTemplate}" x:Name="Chart1" DataContext="{StaticResource data}"> <igChart:XamDataChart.Axes> <igChart:NumericXAxis x:Name="xAxis"/> <igChart:NumericYAxis x:Name="yAxis"/> </igChart:XamDataChart.Axes> <igChart:XamDataChart.Series> <igChart:ScatterLineSeries XAxis="{Binding ElementName=xAxis}" YAxis="{Binding ElementName=yAxis}" ItemsSource="{StaticResource data}" XMemberPath="xmapping" YMemberPath="ymapping"/> </igChart:XamDataChart.Series> </igChart:XamDataChart>
Hope this helps!
Marisa
I am having a problem implementing the above using polygons. It seems that once you define the points for a polygon, thats it's size and trying to modify the polygons size using MinWidth or Width only clips part of the polygon shape off if the Width or Height property is set to small.
<DataTemplate x:Key="TriangleMarkerTemplate"> <Polygon Points="0, 0 8, 16 16, 0" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{Binding ActualItemBrush}" Stroke="{Binding Series.ActualMarkerOutline}" StrokeThickness="0.5" Width="{Binding Source={x:Static local:MySettings.Default}, Path=tmMarkerSize}" Height="{Binding Source={x:Static local:MySettings.Default}, Path=tmMarkerSize}"/> </DataTemplate>
For example if tmMarkersize<16 then part of the Triangle will just be clipped off, not resized.
Hi Marisa,
Thanks for the quick response. So I guess that we'd have to do the same thing for each of the marker templates if we're using more than just the circle markers (circle, pentagon, hexagon, etc.). And without a series property for marker size to support binding like you're using for Stroke, I'm not sure how we'd be able to use this approach for having the marker size be series-specific rather than using the same size for all circle markers on the chart. Hopefully this request will get picked up for 11.1.
Thanks,
Darcy