From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-07-2016 03:38 AM
Hi,
In the attached project I have a check-box which decide if the graph contains main y axis or y axis for each exist plot.
in the follow picture you can see the first screen with data :
After that, I choose the seperate check box that cause the graph disapear (because have 5 axes) - and it's OK for me.
The problem occures when I unchecked the seperate check box, the data disrupted. You can see that in the following picture:
This will be fixed when you move the graph by ctrl + left mouse.
Why is it happening and how can I fix this?
Solved! Go to Solution.
09-08-2016 11:09 AM
Hello,
I downloaded the zip file, and I am seeing the same behavior. I have an idea as to what could be the cause, but I would need more information on your solution to better find out where the behavio is happening
It seems like the code is stretching the data that is on there when you uncheck the selector box. Exactly what snippet of code is executing when you check and uncheck the multiple axis? Would it be possible to redraw the graph whenever the box is unchecked?
Best,
Shamik C
Applications Engineer
National Instruments
09-09-2016 10:37 AM
After further investigation, this appears to be an issue with the graph trying to re-use a subset of previously decimated data, and not recognizing the change to the plot area size when the axes are hidden.
As Shamik mentioned, the best workaround would be to schedule a refresh whenver the mode is toggled:
Dispatcher.BeginInvoke( new Action( graph.Refresh ), DispatcherPriority.Loaded );
09-18-2016 03:27 AM
09-19-2016 09:38 AM
It is difficult to say if there is a single event that will catch everything you want without filtering out cases that you do not want.
You could either find cases for everything that you specifically need and put that code in each one. Or, you could have something as vague as a mouse click or timer event to constantly refresh the graph. Personally, I would do the former.
09-19-2016 10:05 AM
I don't believe we expose any specific event that would fit this case, but you should be able to use the DesiredPlotAreaMargin
property on the graph. To listen for changes, just bind a property on your window or model to that dependency property, and use the scheduled refresh code from earlier to force the graph to redraw whenever it changes (assuming a refresh has not been queued already).
09-20-2016 02:48 AM
Finally, I solved the problem in the following way:
I register to plot area SizeChanged event, and when the size was greater from the previous size & the previous size was smaller from spesific width (which means that the screen was small and now it is grown), I call the refresh function.
private void PlotArea_SizeChanged(object sender, SizeChangedEventArgs e) { if (e.PreviousSize.Width < 80 && e.NewSize.Width > e.PreviousSize.Width) Application.Current.Dispatcher.BeginInvoke(new System.Action(Refresh), System.Windows.Threading.DispatcherPriority.ContextIdle); }
I change the priority to ContextIdle because when I open the reflect window the loaded priority not help, and for this case I needed lower priority.
07-08-2019 04:42 PM
Just wanted to let you know this issue was fixed in the Measurement Studio 2019 release.