无法正确拖动VerticallyStackedAxes中的AxismarkerAnnotation

时间:2017-07-25 07:53:47

标签: scichart

我使用了SciChart组件的VerticallStackedAxes,并为每个NumericAxis添加了7个AxisMarkerAnnotation,但除了第一个之外,AxisMarkerAnnotations不可拖动。

this is result:

这是我的UserControl代码的一部分:

<s:SciChartSurface.YAxes>
                <s:NumericAxis x:Name="Ch0" Style="{StaticResource YAxisStyle}" Id="Ch0" AxisTitle="Ch0" Grid.Row="0"/>
                <s:NumericAxis x:Name="Ch1" Style="{StaticResource YAxisStyle}" Id="Ch1" AxisTitle="Ch1" Grid.Row="2" />
                <s:NumericAxis x:Name="Ch2" Style="{StaticResource YAxisStyle}" Id="Ch2" AxisTitle="Ch2" Grid.Row="4" />
                <s:NumericAxis x:Name="Ch3" Style="{StaticResource YAxisStyle}" Id="Ch3" AxisTitle="Ch3" Grid.Row="6" />
                <s:NumericAxis x:Name="Ch4" Style="{StaticResource YAxisStyle}" Id="Ch4" AxisTitle="Ch4" Grid.Row="8" />
                <s:NumericAxis x:Name="Ch5" Style="{StaticResource YAxisStyle}" Id="Ch5" AxisTitle="Ch5" Grid.Row="10" />
                <s:NumericAxis x:Name="Ch6" Style="{StaticResource YAxisStyle}" Id="Ch6" AxisTitle="Ch6" Grid.Row="12" />
                <s:NumericAxis x:Name="Ch7" Style="{StaticResource YAxisStyle}" Id="Ch7" AxisTitle="Ch7" Grid.Row="14" />
            </s:SciChartSurface.YAxes>

            <s:SciChartSurface.ChartModifier>
                <s:ModifierGroup>
                    <s:RubberBandXyZoomModifier IsXAxisOnly="True"/>
                    <s:ZoomExtentsModifier/>
                    <s:CursorModifier ShowAxisLabels="False" ShowTooltip="False"/>
                </s:ModifierGroup>
            </s:SciChartSurface.ChartModifier>

            <s:SciChartSurface.Annotations>

                <!-- Draws Bands behind each axis -->
                <s:BoxAnnotation YAxisId="Ch0" CoordinateMode="RelativeX" X1="0" X2="1" Y1="{Binding VisibleRange.Min, ElementName=Ch0}" Y2="{Binding VisibleRange.Max, ElementName=Ch0}" Background="#11000000" AnnotationCanvas="BelowChart"/>
                <s:BoxAnnotation YAxisId="Ch1" CoordinateMode="RelativeX" X1="0" X2="1" Y1="{Binding VisibleRange.Min, ElementName=Ch1}" Y2="{Binding VisibleRange.Max, ElementName=Ch1}" Background="#44B0C4DE" AnnotationCanvas="BelowChart"/>
                <s:BoxAnnotation YAxisId="Ch2" CoordinateMode="RelativeX" X1="0" X2="1" Y1="{Binding VisibleRange.Min, ElementName=Ch2}" Y2="{Binding VisibleRange.Max, ElementName=Ch2}" Background="#11000000" AnnotationCanvas="BelowChart"/>
                <s:BoxAnnotation YAxisId="Ch3" CoordinateMode="RelativeX" X1="0" X2="1" Y1="{Binding VisibleRange.Min, ElementName=Ch3}" Y2="{Binding VisibleRange.Max, ElementName=Ch3}" Background="#44B0C4DE" AnnotationCanvas="BelowChart"/>
                <s:BoxAnnotation YAxisId="Ch4" CoordinateMode="RelativeX" X1="0" X2="1" Y1="{Binding VisibleRange.Min, ElementName=Ch4}" Y2="{Binding VisibleRange.Max, ElementName=Ch4}" Background="#11000000" AnnotationCanvas="BelowChart"/>
                <s:BoxAnnotation YAxisId="Ch5" CoordinateMode="RelativeX" X1="0" X2="1" Y1="{Binding VisibleRange.Min, ElementName=Ch5}" Y2="{Binding VisibleRange.Max, ElementName=Ch5}" Background="#44B0C4DE" AnnotationCanvas="BelowChart"/>
                <s:BoxAnnotation YAxisId="Ch6" CoordinateMode="RelativeX" X1="0" X2="1" Y1="{Binding VisibleRange.Min, ElementName=Ch6}" Y2="{Binding VisibleRange.Max, ElementName=Ch6}" Background="#11000000" AnnotationCanvas="BelowChart"/>
                <s:BoxAnnotation YAxisId="Ch7" CoordinateMode="RelativeX" X1="0" X2="1" Y1="{Binding VisibleRange.Min, ElementName=Ch7}" Y2="{Binding VisibleRange.Max, ElementName=Ch7}" Background="#44B0C4DE" AnnotationCanvas="BelowChart"/>

                <s:AxisMarkerAnnotation X1="0.0" 
                                        Y1="0.0"
                                        YAxisId="Ch0"
                                        IsEditable="True"
                                        LabelTemplate="{StaticResource AxisMarkerTemplate}"
                                        PointerTemplate="{StaticResource DefaultAxisPointerTemplate}"/>

                <s:AxisMarkerAnnotation X1="0.0" 
                                        Y1="0.0"
                                        YAxisId="Ch1"
                                        IsEditable="True"
                                        LabelTemplate="{StaticResource AxisMarkerTemplate}"
                                        PointerTemplate="{StaticResource DefaultAxisPointerTemplate}"/>
            </s:SciChartSurface.Annotations>

您可以在此网址中找到源代码: https://github.com/ABTSoftware/SciChart.WPF.Examples/tree/master/v4.x/Examples/SciChart.Examples/Examples/ModifyAxisBehaviour 感谢

2 个答案:

答案 0 :(得分:1)

来自轴类的GetDataValue中存在一个错误,它不会计算yaxis偏移量。 在我的一个项目中,我修复了这个类的问题:

DEFINE QLOCAL(CQLOCAL) CLUSTER('YOURCLUSTER') CLWLUSEQ(ANY)

答案 1 :(得分:0)

我能够重现这个问题,并且正在调查它。 您也可以在此处跟踪问题的进展情况===&gt;&gt;&gt; https://abtsoftware.myjetbrains.com/youtrack/issue/SC-4202

Nazar Pelyushkevych, SciChart WPF团队