ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph control plotting area stretching

Solved!
Go to solution

Hi,

 

We are using NationalInstrument.Controls.Graph from Measurement Studio 2015 in our C# WPF projects. And we just found that, after doing some zooming in, the right edge of the plot area stretches to the right in length. Is there a way to freeze the plot area in its size programmatically? Please find attached the before and after snapshots.

 

Thank you very much,

OxTS

 

Download All
0 Kudos
Message 1 of 3
(2,643 Views)
Solution
Accepted by topic author OxTS

You can use DesiredPlotAreaMargin to read the size requested by all of the scales, and use PlotAreaMargin to specify a fixed value for any or all of the edges. For example, graph.PlotAreaMargin = new Thickness( double.NaN ) { Right = 100 } will fix the right edge at 100 pixels wide, and let the other sides continue to match the DesiredPlotAreaMargin produced by the scales.

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

Hi Paul,

graph.PlotAreaMargin is just what I was looking for. Thank you very much!

~OxTS

0 Kudos
Message 3 of 3
(2,613 Views)