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.
Thanks for the fast reply Marisa. I just noticed I didn't have the Stretch property set to Fill and that was the whole problem.
Hi,
I found that playing with the Points collection on the Polygon would adjust the size of the Triangle marker accordingly. For example if you have this as your TriangleMarkerTemplate:
<DataTemplate x:Key="TriangleMarkerTemplate"> <Polygon Points="0, 0 3, 6 6, 0" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{Binding ActualItemBrush}" Stroke="{Binding Series.ActualMarkerOutline}" StrokeThickness="0.5" /> </DataTemplate>
You would get a result like this, a much smaller marker:
Or, if you set your TriangleMarkerTemplate to something like this:
<DataTemplate x:Key="TriangleMarkerTemplate"> <Polygon Points="0, 0 10, 20 20, 0" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{Binding ActualItemBrush}" Stroke="{Binding Series.ActualMarkerOutline}" StrokeThickness="0.5" /> </DataTemplate>
You would have a much larger marker in this instance:
Hopefully playing with these values will help you achieve what you're looking for.
-Marisa