Add Grid Lines to an Intensity Graph in Measurement Studio

Updated Dec 7, 2022

Reported In

Software

  • Measurement Studio

Issue Details

Is there a way to add grid lines to an Intensity Graph in Measurement Studio when using Windows Forms (WinForms) and C#?

Solution

The AfterDrawPlot event is used to draw the grid lines on an intensity graph, you can use this event in conjunction with custom drawing to further annotate the plot. Only plots contained in the graph plot collection raise AfterDrawPlot after the plot has completed drawing.
 
Include the following lines in your code to draw the grid lines in your graph:
 
private void intensityGraph1_AfterDrawPlot(object sender, NationalInstruments.UI.AfterDrawIntensityPlotEventArgs e)
{
    intensityGraph1.DrawGridLines(new NationalInstruments.UI.ComponentDrawArgs(e.Graphics, e.Bounds));
}

 
Note: intensityGraph1 is the object name for this specific code example, make sure to include the proper name of the intensity graph used on the program.

Additional Information

For more information regarding classes, their methods, and their properties, check the Measurement Studio Help files. To access this information go to: Extensions>>Measurement Studio>>Measurement Studio Help.