Pre loader

Color preview not showing in legend when using custom pointmaker

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

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?

Version
4.0
Images
  • You must to post comments
0
0

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

  • You must to post comments
0
0

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.

  • You must to post comments
0
0

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

  • You must to post comments
0
0

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.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies