Pre loader

AnnotationCreationModifier and multiple axes

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

Hi,

I have a chart with 4 axes (two X and two Y), when I try use AnnotationCreationModifier to create annotation, I get next error:

at Abt.Controls.SciChart.Visuals.Annotations.AnnotationBase.FromCoordinates(Double xCoord, Double yCoord)
at Abt.Controls.SciChart.Visuals.Annotations.AnnotationBase.FromCoordinates(Point coords)
at Abt.Controls.SciChart.Visuals.Annotations.AnnotationBase.UpdatePosition(Point point1, Point point2)
at Abt.Controls.SciChart.ChartModifiers.AnnotationCreationModifier.OnModifierMouseUp(ModifierMouseArgs mouseButtonEventArgs)
at Abt.Controls.SciChart.ChartModifiers.ModifierGroup.c9fd5ab524d787e8439d8933aeb87fdc5(IChartModifier c6b1effd112e5355cd5f051dd91cd4f67, ModifierMouseArgs cbb39038dde40bfc3fdcfa70f4bbf8778)
at Abt.Controls.SciChart.ChartModifiers.ModifierGroup.c9e8960a6a8527c20ac9e46e162c72b22(Action`2 c4bd4ab823835cf92d221476b6fb65a17, ModifierMouseArgs c4c23d80d4d060e409c3479ef17d6c65e)
at Abt.Controls.SciChart.ChartModifiers.ModifierGroup.OnModifierMouseUp(ModifierMouseArgs e)
at Abt.Controls.SciChart.Utility.Mouse.MouseManager.cad56cb88fe961ec17710025afdf79607(ModifierMouseArgs cbb39038dde40bfc3fdcfa70f4bbf8778, IReceiveMouseEvents c18509698be3f9366c690e7d2b107b62c, Boolean c3791a1b71c1577bde30b55c12b2a5583)
at Abt.Controls.SciChart.Utility.Mouse.MouseManager.cf88844ca415efe316ebbc6460c4d5477.c017276be757b162458755f3f8e0c9aa6.cd7319400482f82418e9a97b614eab2ca(IReceiveMouseEvents c133657388cc0f6f6615e21e129ac4b3a)
at A.c19dd4d74f6373c95c517d29624d76e4b.cacf72b657252e3e73860afb89d70cb9f[c13c28af86f0b14202b9c7ef43b1bd11a](IEnumerable`1 c40a30a1bb6416cd164565919fdef15a9, Action`1 c885aac61bc9832561b7ff07903c88d5e)
at Abt.Controls.SciChart.Utility.Mouse.MouseManager.cf88844ca415efe316ebbc6460c4d5477.cef5451dcf09f913b48c9730b7cb0d11d(Object cae49ecc8585f35e8dd5ce624f7fb7ab5, MouseButtonEventArgs c4c23d80d4d060e409c3479ef17d6c65e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run()
at SciTest.App.Main() in d:\Projects\Test\SciChart\SciTest1\SciTest\obj\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

My Xaml code:

<s:SciChartSurface x:Name="sciChart" Grid.Row="1" ClipModifierSurface="True" s:ThemeManager.Theme="Chrome">

    <s:SciChartSurface.RenderableSeries>
        <s:FastCandlestickRenderableSeries XAxisId="X" YAxisId="Y"/>
    </s:SciChartSurface.RenderableSeries>

    <s:SciChartSurface.XAxes>
        <s:CategoryDateTimeAxis Id="X"/>
        <s:CategoryDateTimeAxis Id="X2"/>
    </s:SciChartSurface.XAxes>

    <s:SciChartSurface.YAxes>
        <s:NumericAxis TextFormatting="0.0#" Id="Y"/>
        <s:NumericAxis TextFormatting="0.0#" Id="Y1"/>
    </s:SciChartSurface.YAxes>

    <s:SciChartSurface.ChartModifier>
        <s:ModifierGroup>
            <s:AnnotationCreationModifier YAxisId="Y" x:Name="annotationCreation" AnnotationCreated="OnAnnotationCreated"/>
            <s:YAxisDragModifier/>
            <s:XAxisDragModifier/>
        </s:ModifierGroup>
    </s:SciChartSurface.ChartModifier>

</s:SciChartSurface>
  • You must to post comments
0
0

Hi there,

Thanks for reporting this! We could reproduce it on our side. It is related to multiple X axes, but AnnotationCreationModifier doesn’t provide the XAxisId property for such cases, so we will add it in next version. Fortunately, there is a simple workaround, you need to set XAxisId for used anotation types, and this can be done inside Style. Please, take a look at our Create annotations dynamically example, you can find annotation styles defined inside UserControl.Resources definition.
Just add a setter for XAxisId:

        <Style x:Key="TextAnnotationStyle" TargetType="s:TextAnnotation">
            <Setter Property="XAxisId" Value="[axis id]"/>
            ...
        </Style>

Please, let us know if the above helps!

Best regards,
Yuriy

  • esper
    Уes, it helped. Thanks.
  • You must to post comments
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