11-03-2014 11:27 AM
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?
Solved! Go to Solution.
11-03-2014 01:12 PM
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
.
11-03-2014 01:53 PM
That was the problem. Thanks for your quick response.