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
- Marc Vahldieck asked 11 months ago
- You must login to post comments
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:
- Create a new project with SciChartSurface & Axis & one Button
- Button click event handler, toggle axis.DrawMajorGridLines = true / false
- Try this with SciChart WPF v6.6.0 and also latest version 7.0.2
- 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
- Andrew Burnett-Thompson answered 11 months ago
- You must login to post comments
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
- Marc Vahldieck answered 11 months ago
-
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 login to post comments
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.
- Marc Vahldieck answered 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 login to post comments
Please login first to submit.