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.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Intensity graph gridlines not visible

Solved!
Go to solution

Hi to all,

I cannot seem to get to show the grid lines on an intensity graph. They do show anywhere there is no data, but where there is data they are hidden. Is this a bug or am I doing something wrong?

 

    griStats.Plot(stats)
    intensityPlot.PixelInterpolation = True

    griStats.XAxes(0).MajorDivisions.GridLineStyle = UI.LineStyle.Solid
    griStats.XAxes(0).MajorDivisions.GridColor = Color.Black
    griStats.XAxes(0).MajorDivisions.Base = 0
    griStats.XAxes(0).MajorDivisions.Interval = 1
    griStats.XAxes(0).MajorDivisions.GridVisible = True
    griStats.XAxes(0).Range = New UI.Range(0, UBound(twa))

    griStats.YAxes(0).MajorDivisions.GridLineStyle = UI.LineStyle.Solid
    griStats.YAxes(0).MajorDivisions.GridColor = Color.Black
    griStats.YAxes(0).MajorDivisions.Base = 0
    griStats.YAxes(0).MajorDivisions.Interval = 1
    griStats.YAxes(0).Range = New UI.Range(0, UBound(tws))
    griStats.YAxes(0).MajorDivisions.GridVisible = True

 

Thanks for your help,

CD

0 Kudos
Message 1 of 6
(4,040 Views)

It looks very much like a z-order problem or something of the sort.

0 Kudos
Message 2 of 6
(4,034 Views)
Solution
Accepted by cdouillet

Hey there,

 

Try this. Hook on to the IntensityGraph.AfterDrawPlot event.

 

 

private void intensityGraph1_AfterDrawPlot(object sender, NationalInstruments.UI.AfterDrawIntensityPlotEventArgs e)
{
intensityGraph1.DrawGridLines(new NationalInstruments.UI.ComponentDrawArgs(e.Graphics, e.Bounds));
}

 

 

Hope this helps.

 

Vijet Patankar,

National Instruments

Message 3 of 6
(4,004 Views)

That worked great, thank you very much.

CD

0 Kudos
Message 4 of 6
(3,982 Views)

Hi, is this still the only way?  This solution is from 2011 so perhaps there's a setting instead of this "hack"?

By the way, I am using WPF so not even sure if this solution will work.

 

Thank you!

0 Kudos
Message 5 of 6
(3,375 Views)

This post does not pertain to WPF. Please create a new thread describing the issue you are seeing with the WPF graph.

 

Thanks,

Daniel Dorroh
National Instruments
0 Kudos
Message 6 of 6
(3,363 Views)