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
- lorenzo522 asked 9 years ago
- You must login to post comments
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?
- Andrew Burnett-Thompson answered 9 years ago
- You must login to post comments
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
- lorenzo522 answered 9 years ago
-
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.
-
Thank you Andrew. It works like a charm
- You must login to post comments
Please login first to submit.