Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Development Studio Graph control plots dim

Solved!
Go to solution

I am drawing a graph using the Development Studio Graph control and the following code:

 

                NationalInstruments.Controls.Plot insertionLossPlot = new NationalInstruments.Controls.Plot();
                NationalInstruments.Controls.Rendering.LinePlotRenderer insertionLossLinePlotRenderer = new NationalInstruments.Controls.Rendering.LinePlotRenderer();
                insertionLossLinePlotRenderer.Stroke = Brushes.Magenta;
                insertionLossPlot.Renderer = insertionLossLinePlotRenderer;


                NationalInstruments.Controls.Plot returnLossPlot = new NationalInstruments.Controls.Plot();
                NationalInstruments.Controls.Rendering.LinePlotRenderer returnLossLinePlotRenderer = new NationalInstruments.Controls.Rendering.LinePlotRenderer();
                returnLossLinePlotRenderer.Stroke = Brushes.Green;
                returnLossPlot.Renderer = returnLossLinePlotRenderer;

                this.NationalInstrumentsGraph.Plots.Clear();
                this.NationalInstrumentsGraph.Plots.Add(insertionLossPlot);
                this.NationalInstrumentsGraph.Plots.Add(returnLossPlot);

                this.NationalInstrumentsGraph.Data.Clear();
                this.NationalInstrumentsGraph.Data.Add(insertionLossPoints);
                this.NationalInstrumentsGraph.Data.Add(returnLossPoints);

 

The plots are drawn correctly, but after about 2 seconds the lines move slightly and their brightness appears to reduce slightly.

 

I can not see any graph properties which would explain this.

 

Can anyone explain this?

0 Kudos
Message 1 of 3
(4,670 Views)
Solution
Accepted by topic author Dick42

From your description, it sounds like you are plotting a large amount of data to the graph at once. In the default RenderMode configuration of Auto, the graph will detect the large data and default to Raster mode. After a short timeout, the graph will see that data is not being updated with a high frequency, and will automatically switch to Vector, which uses anti-aliasing and can give diagonal lines a lighter appearance.


To avoid the automatic switching, just set RenderMode to a value other than Auto.

~ Paul H
0 Kudos
Message 2 of 3
(4,665 Views)

That was the problem. Thanks for your quick response.

0 Kudos
Message 3 of 3
(4,662 Views)