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!

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
    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.