Pre loader

Null Exception thrown by sciChartSurface.YAxis.GrowBy

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

Null pointer exception in one of your libraries.

        DoubleRange dtest = new DoubleRange(0.2, 0.2);
        //sciChartSurface.YAxis.GrowBy = new DoubleRange(0.2, 0.2);

        sciChartSurface.YAxis.GrowBy = dtest;

Using simple line chart demo
Builds without errors.
dtest object is valid (checked at breakpoint
When growby functions called received null pointer exception
log below comes from output window VS2015
Help!

Hello World!
Instantiating SciChartSurface
SciChartSurface.IsSuspended=true. Ignoring InvalidateElement() call
SciChartSurface.IsSuspended=true. Ignoring InvalidateElement() call
SciChartSurface.IsSuspended=true. Ignoring InvalidateElement() call
‘SciChartDemo.vshost.exe’ (CLR v4.0.30319: SciChartDemo.vshost.exe): Loaded ‘C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.Aero2\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.Aero2.dll’. Skipped loading symbols. Module is optimized and the debugger option ‘Just My Code’ is enabled.
SciChartSurface.IsSuspended=true. Ignoring InvalidateElement() call
SciChartSurface.IsSuspended=true. Ignoring InvalidateElement() call
SciChartSurface.IsSuspended=true. Ignoring InvalidateElement() call
SciChartSurface.IsSuspended=true. Ignoring InvalidateElement() call
SciChartSurface.IsSuspended=true. Ignoring InvalidateElement() call
OnApplyTemplate
SciChartSurface.IsSuspended=true. Ignoring InvalidateElement() call
SciChartSurface.IsSuspended=true. Ignoring InvalidateElement() call
‘SciChartDemo.vshost.exe’ (CLR v4.0.30319: SciChartDemo.vshost.exe): Loaded ‘C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXml\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXml.dll’. Skipped loading symbols. Module is optimized and the debugger option ‘Just My Code’ is enabled.
SciChartSurface Resized: x=510.4 y=312.8
Publishing SciChartResizedMessage, Sender=SciChartSurface
SciChartSurface.IsSuspended=true. Ignoring InvalidateElement() call
Publishing RenderSurfaceResizedMessage, Sender=HighSpeedRenderSurface
SciChartSurface.IsSuspended=true. Ignoring InvalidateElement() call
Publishing RenderSurfaceResizedMessage, Sender=HighSpeedRenderSurface
‘SciChartDemo.vshost.exe’ (CLR v4.0.30319: SciChartDemo.vshost.exe): Loaded ‘C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CLIENTDIAGNOSTICS\XAMLDIAGNOSTICS\x64\WpfXamlDiagnosticsTap.dll’. Skipped loading symbols. Module is optimized and the debugger option ‘Just My Code’ is enabled.
‘SciChartDemo.vshost.exe’ (CLR v4.0.30319: SciChartDemo.vshost.exe): Loaded ‘C:\WINDOWS\assembly\GAC\Microsoft.VisualStudio.OLE.Interop\7.1.40304.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.OLE.Interop.dll’. Module was built without symbols.
‘SciChartDemo.vshost.exe’ (CLR v4.0.30319: SciChartDemo.vshost.exe): Loaded ‘C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationTypes.dll’. Skipped loading symbols. Module is optimized and the debugger option ‘Just My Code’ is enabled.
The program ‘[13008] SciChartDemo.vshost.exe’ has exited with code -1 (0xffffffff).

  • You must to post comments
0
0

Hi there,

Which object is null? Do you have a stack trace?

From the code you’ve shared, the only candidates are SciChartSurface, or YAxis being null. If it’s YAxis, please ensure you create a new YAxis e.g. SciChartSurface.YAxis = new NumericAxis().

Best regards,
Andrew

  • Bill.Johnson
    Color my face red. Missed 3 lines of xaml that defined the YAxis. Added that in and the null pointer exception went away. Thanks.
  • Andrew Burnett-Thompson
    That’s fine! I’m glad it’s not a problem and you are up and running :)
  • 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