Hi,
I’ve noticed that when I use a custom pointmaker on a renderable series, the preview of the color of that series is missing from the legend of the graph. How can I make it show there? Do I need to update some private property with the “Fill/Stroke” color of the pointmaker?
- Jonathan Janesjö asked 7 years ago
- You must login to post comments
Hi,
Ok thanks. I’ll try that. I was just wondering if there was a way to just use the exact same one as one of the default pointmarkers instead of having to create one myself.
- Jonathan Janesjö answered 7 years ago
- You must login to post comments
Hi Daniel,
They are pretty simple – just an appropriate shape or a Path. For example, this is the default style for the TrianglePointMarker:
<Style BasedOn="{StaticResource DefaultPointMarker}" TargetType="pointMarkers:TrianglePointMarker">
<Setter Property="PointMarkerTemplate">
<Setter.Value>
<ControlTemplate>
<Grid>
<Polygon Width="{Binding DataContext.PointMarker.Width, RelativeSource={RelativeSource TemplatedParent}}"
Height="{Binding DataContext.PointMarker.Height, RelativeSource={RelativeSource TemplatedParent}}"
Fill="{Binding DataContext.PointMarker.Fill, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ColorToBrushConverter}}"
Points="0,1 1,1 0.5,0 0,1"
Stretch="Uniform"
Stroke="{Binding DataContext.PointMarker.Stroke, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ColorToBrushConverter}}"
StrokeThickness="{Binding DataContext.PointMarker.StrokeThickness, RelativeSource={RelativeSource TemplatedParent}}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
So you can do something like this on your side.
Best regards,
Yuriy
- Yuriy Zadereckiy answered 7 years ago
- You must login to post comments
Hi,
Sounds great! How/Where do I find the default PointMarkerTemplates of SciChart? I’d like to just reuse the default one of the EllipsePointMarker.
- Jonathan Janesjö answered 7 years ago
- You must login to post comments
Hi Daniel,
Thanks for your question. There is the PointMarkerTemplate property. It is used to show a preview in a Legend. You have to set it to a ControlTemplate containing the desired preview.
Hope this helps!
Best regards,
Yuriy
- Yuriy Zadereckiy answered 7 years ago
- You must login to post comments
Please login first to submit.