Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems: Changing LineWidth on ScatterGraph plots with many points take a while.

Hello All,

I currently have a scattergraph with 20+ plots with around 25000 - 30000 points in each.  The graph is use for trend data over a period of 100 hours.  At the end of the test, since the plots are in a CheckedListBox; what's I will like to do is when the user select a plot, the plot LineWidth will change from 1 to 3.  So the user will have good visibility on which of the device failed. 

The code is ok for couples thousands points but for 25000+ points, the scattergraph take about 40 seconds to repaint itself on the form to repaint 1 plots. 

Part of my code...

            'Change all graph line width to 1 (This is very quick)
            For intGraphLoop = 0 To (ScatterGraph.Plots.Count - 1)
                ScatterGraph.Plots(intGraphLoop).LineWidth = 1
            Next intGraphLoop

             'Circle thru the list and get the one selected
                If (lstDutPathMeas.GetItemChecked(lstDutPathMeas.SelectedIndex) = True) Then
                    If (ScatterGraph.Plots(lstDutPathMeas.SelectedIndex).Visible = True) Then
                        'Get a the item selected and Bold the graph.
                        ScatterGraph.Plots(lstDutPathMeas.SelectedIndex).LineWidth = 2
                    End If
                    ScatterGraph.Refresh()
                End If

I'm using Measurement Studio 7.1.0.306

Thanks all for you time,

- Sebastien
0 Kudos
Message 1 of 7
(4,218 Views)
When the LineWidth of one of the plots is changed, the entire plot area of the graph is repainted. If you have a lot of plots with a lot of data points in them, then repainting all of it is going to take some time. In your code, I noticed that you are calling ScatterGraph.Refresh. Setting the LineWidth of the plot should automatically refresh the graph without you needing to manually call Refresh on it. Since we are already refreshing the graph and you are calling another Refresh on top of it, that might explain why the graph is taking so long. You should try to remove the call to Refresh and see if that makes the graph faster. Please let us know how this works.
 
Abhishek Ghuwalewala | Measurement Studio | National Instruments
0 Kudos
Message 2 of 7
(4,209 Views)
Hello Abhishek,

Thanks for the quick response.  I've removed the
ScatterGraph.Refresh() but the problem is still there.  I've checked this with a timer and the time is the same.  I guess that a refresh on top of a refresh doesn't take more time after the change are complete.

I've done some checked on the LineStyle and I've noticed that changing the LineStyle, is very quick compare to LineWidth.  A couple of seconds compare to 40+ seconds.  I don't know exactly what's involved in the LineWidth that make it so slow ???

Thanks,

- Sebastien
0 Kudos
Message 3 of 7
(4,207 Views)
I am curious to know how many data points are actually visible in your plot area? Are you viewing all 25000-30000 points across 20+ plots at the same time?
 
I would also like to point out that we have made significant improvements to the performance of the scatter graph since Measurement Studio 7.1. I would encourage you to upgrade your version of Measurement Studio to get the latest graph enhancements. You can download a 30 day evaluation of the latest version of Measurement Studio to determine if the performance is suitable for your application.
Abhishek Ghuwalewala | Measurement Studio | National Instruments
0 Kudos
Message 4 of 7
(4,204 Views)
The upgrade I do not believe will help the poor performance.  After having evaluated the new NI Graph, we opted out and went back to the ActiveX control, which has excellent plotting performance.  We can throw up around 50 curves with 256,000 points each at one time with out any degradation in performance.  Cursors work well and linewidth of 2 has no side effect.
 
When we did this on the latest NI Graph 8.01, the graph came to it's knees.
 
Scott
0 Kudos
Message 5 of 7
(4,198 Views)
Please could you let us know how many plots and data points are visible in the plot area of your graph when you make changes to the LineWidth? I would like to know if you are viewing all of the data at the same time or some part of it when attempting to change the LineWidth of the plot. If you can provide us with a small program that demonstrates this behavior it would help us in getting to the bottom of the issue.
Abhishek Ghuwalewala | Measurement Studio | National Instruments
0 Kudos
Message 6 of 7
(4,194 Views)
Hello,

Yes, I am viewing all 25000-30000 points across 20+ plots at the same time.  I don't think this should be a problem.

If instead of using the LineWidth
ScatterGraph.Plots(index).LineWidth = 1

I use the Point style, it's much faster... (can't even compare the two)
ScatterGraph.Plots(index).PointStyle = PointStyle.SolidCircle

I will be hard for me (not impossible) to create a small application, I'll see what I can do.

Thanks,

- Sebastien
0 Kudos
Message 7 of 7
(4,191 Views)