Pre loader

SeriesValueModifier on another side of the chart

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

I want to use the SeriesValueModifier to show the values. However the SeriesValueModifier are always shown at the y-axis wich has the values. I would like to show the y-axis on the left side of the chart. That’s no problem. After that i want to show the SeriesValueModifier on the right side of the chart while the y-axis remains at the left sid. How can i do this?

  • You must to post comments
0
0

Hi,

You need to declare one hidden Y axis and set the YAxisId property to Id of this axis. Please, take a look at the following code:

    <Style x:Key="CustomMarkerStyle" TargetType="s:AxisMarkerAnnotation">
        <Setter Property="YAxisId" Value="hiddenAxis" />
        <!-- Both Background &amp; BorderBrush are bound to the SeriesColor property -->
        <Setter Property="Background" Value="{Binding SeriesColor, Converter={StaticResource ColorToBrushConverter}}" />
        <Setter Property="BorderBrush" Value="{Binding SeriesColor, Converter={StaticResource ColorToBrushConverter}}" />
        <Setter Property="Foreground" Value="White" />
    </Style>

  .....

<s:SciChartSurface>
  .....
  <s:SciChartSurface.YAxes>
        <s:NumericAxis x:Name="visibleAxis" AxisAlignment="Left" .../>
        <s:NumericAxis x:Name="hiddenAxis" Width="30" DrawLabels="False" DrawMajorTicks="False" DrawMinorTicks="False" VisibleRange="{Binding VisibleRange, ElementName=visibleAxis}" Id="hiddenAxis"/>
  </s:SciChartSurface.YAxes>

  ....

  <s:SciChartSurface.ChartModifier>
    <s:ModifierGroup>

      <!-- SeriesValueModifier: This Provides axis markers per series, for each RenderableSeries that -->
      <!-- has SeriesValueModifier.IsSeriesValueModifierEnabled=True -->
                <s:SeriesValueModifier AxisMarkerStyle="{StaticResource CustomMarkerStyle}"/>

    </s:ModifierGroup>
  </s:SciChartSurface.ChartModifier>

Also, I’ve compiled a small example for you based on our Reltime Series-Values demo. Please, find it attached below.

Please, try it and let us know if it helps. If any questions arise or clarification needed, don’t hesitate to ask – we are glad to assist.

Best regards,
Yuriy

  • bochelie
  • bochelie
    I dont know why but i cant place my xaml code.
  • bochelie
    Ok Thanks. It turns out the xaml was good from the first time. I had this in my behind code: "sciChartSurface.YAxis.GrowBy = new DoubleRange(0.1, 0.1);" I see that you do that in xaml. So i removed the line from the code behind and now it works. Thanks a lot! Just one more question. In the behind code i use "IDataSeries" whil you use "IXyDataSeries". Wich one is better? There is not much information in the documentation about this.
  • Yuriy Zadereckiy
    Hi there, Glad that you get it working! ..and regarding the question, there is no difference, because IXyDataSeries implements IDataSeries. So it's up to you: if you need to access some specific methods(such as the Insert(..) method), you would better use IXyDataSeries[TX,TY]. Also the generic version should be faster because of no boxing/unboxing is done. Best regards, Yuriy
  • Karl Müller
    Hi. Is there a way to do this without having to create a hidden YAxis? I need to display more than one YAxis which also can be added and removed dynamically. So, setting the AxisMarkerStyle explicitely for a specific YAxisId is not possible in my case. Thanks a lot.
Showing 1 result
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