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?
- bochelie asked 10 years ago
- You must login to post comments
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 & 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
- Yuriy Zadereckiy answered 10 years ago
- last edited 9 years ago
-
-
I dont know why but i cant place my xaml code.
-
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.
-
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
-
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.
- 1 more comment
- You must login to post comments
Please login first to submit.