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!
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
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 Darcy,
Yes, unfortuantely with this approach you would have to do this with each of the different markers outside of circle. However, as for the part about having this approach be series specific, you can set the MarkerTemplate property of a series to the template you've created in your resources. This way you can have several different templates and apply them to different series as necessary. This may make you have to create extra templates, but unfortunately for now that's the best solution.
Thanks,
Marisa
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.
Darcy