SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Answered
0
0

Hi,
I’ve been trying to use CustomPointMarker to build a custom candle, but I need something like

CurrentRenderPassData.YCoordinateCalculator.GetCoordinate(yValue) to know the coordinates of a certain y value in the screen.

I look up CustomPointMarker documentation, but I haven’t found anything.

could you please help me?

Thank you

  • You must to post comments
Best Answer
0
0

Good question.

I think your best bet is to pass the parent BaseRenderableSeries to the BasePointMarker derived class.

That way you can access BaseRenderabeSeries.CurrentRenderPassData.

Can you try it?

  • You must to post comments
0
0

I had no luck, but I don’t know if I did the right thing:
from your SciChart_SeriesWithMetadata example. In the xaml I inserted a dependency property called RenderPD

  <!--  Declare RenderableSeries  -->
        <s:SciChartSurface.RenderableSeries>
            <s:FastLineRenderableSeries x:Name="lineSeries"
                                        StrokeThickness="2"
                                        PaletteProvider="{StaticResource GainLossPaletteProvider}"
                                       >
                <s:FastLineRenderableSeries.PointMarker>
                    <seriesWithMetadata:AnnotatedPointMarker x:Name="AnnotatedPM" RenderPD="{Binding ElementName=lineSeries,Path=CurrentRenderPassData}" Width="5" Height="7" GainMarkerFill="LimeGreen" LossMarkerFill="Red" Stroke="White" StrokeThickness="1"/>
                </s:FastLineRenderableSeries.PointMarker>

In the AnnotatedPointMarker class

   public class AnnotatedPointMarker : BasePointMarker
{

    public IRenderPassData RenderPD
    {
        get { return (IRenderPassData)GetValue(RenderPDProperty); }
        set { SetValue(RenderPDProperty, value); }
    }

    public static readonly DependencyProperty RenderPDProperty =  DependencyProperty.Register("RenderPD", typeof(IRenderPassData), typeof(AnnotatedPointMarker));

I got no errors, but in the draw() method the variable RenderPD is alwasy set to null.

Am I doing something wrong?

Otherwise, (tell me If I have to open a new ticket for this request) I can use a CustomRenderableSeries, but which is the best practice to send metadata to the draw() method?

thanks

  • Andrew
    That’s because BaseRenderableSeries.CurrentRenderPassData is not a depedency property. You can try instead binding from BasePointMarker to BaseRenderableSeries instead. Change your new dependency property type to BaseRenderableSeries, change your binding to Path=. then inside BasePointMarker you will have an instance of BaseRenderableSeries and can get CurrentRenderPassData.
  • lorenzo522
    Thank you Andrew. It works like a charm
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.