Pre loader

DrawMajorGridLines-property of NumericAxis only visible after resize

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

Answered
1
0

Hello,

I’m experiencing a strange phenomenon in which the (in-)visibility of the MajorGridLines of the X-and Y-Axis is only realized in the GUI after the SciChartSurface containing the Axis has been manually resized.

The SciChartSurface is embedded in our GUI like any ordinary WPF-element.

The visibility of the MajorGridLines is controlled via a C#-property:

public virtual bool BackgroundGridVisibility       
   {
              get {
                  return m_yAxis.DrawMajorGridLines;
              }
              set {       
                  m_xAxis.DrawMajorGridLines = m_yAxis.DrawMajorGridLines = value;
                  NotifyPropertyChanged();
              }       
   }
  

I tried various application of the UpdateLayout-Funktion after setting the visibility, but did not observe positive change.

Is there some other kind of “repaint”-function that can be used to update the visibility of the GridLines?

Thank you

Version
v6.6.0.26505
Images
  • You must to post comments
Best Answer
0
0

Hi Marc

All the properties in SciChart WPF are reactive, so if you set Axis.DrawMajorGridLines in code, then the axis should redraw.

You can force a redraw by calling SciChartSurface.InvalidateElement()

If the gridlines still don’t appear after doing this, then I suggest:

  1. Create a new project with SciChartSurface & Axis & one Button
  2. Button click event handler, toggle axis.DrawMajorGridLines = true / false
  3. Try this with SciChart WPF v6.6.0 and also latest version 7.0.2
  4. If the issue occurs in a simple project in 7.0.2 let us know, we will report it as a bug

Best regards
Andrew

  • You must to post comments
0
0

Hello Andrew,

sry, but InvalidateElement seems to have no effect in v6.6.0 or in 7.0.2.

I did the steps you outlined and created a simple test project with v7.0.2, to demonstrate the issue. Is there a way to send you the test project?

Best regards

  • Andrew Burnett-Thompson
    Hi Marc – please email it over to support [at] scichart [dot] com referencing this forum post. You can also attach projects to the forums, just make sure total file size is under 10MB (remove bin, obj folders). In our SciChart WPF demo, the example “Modify Axis Properties” dynamically changes the majorgridlines visibility and the chart updates so we will need your code to reproduce. Best regards, Andrew
  • You must to post comments
0
0

I have sent the mail with the reference and the test-project attached.
Additionally, I attach the project here if that is ok. I removed the scichart-dll´s to keep it small.

Attachments
  • Lex
    • Lex
    • 10 months ago
    Hi Marc, Thank you for the sample project. Let’s continue our discussion in the support ticket for now to avoid message duplication. With best regards, Lex SciChart Technical Support Engineer
  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.