04-14-2016 01:45 AM
Can measurement studio waveform graph axes caption be programmatically modified? And if not, then why not?
Solved! Go to Solution.
04-15-2016 10:40 AM
Hi CraigByrd
Yes, you should be able to edit waveform graph axis captions at runtime. Are you using a Windows Form Application or a WPF Application?
04-15-2016 12:41 PM
Thank you for your quick response.
I am developing an NI VISA Windows Application using Visual Studio 2010.
04-18-2016 04:08 PM - edited 04-18-2016 04:09 PM
Hi CraigByrd
You should be able to set the property at runtime by typing the following:
<Object instance of your waveform plot here>.XAxis.Caption="Insert Text Here";
04-18-2016 06:08 PM
Thanks to your solution repsonse I was able solve the problem.
It turns out the X & Y captions were not part of the wave form graph , but rather a separate xAxis1 and yAxis1 were present in the form1.Designer.cs file as shown below:
//
// wfgPLOT
//
this.wfgPLOT.Location = new System.Drawing.Point(689, 371);
this.wfgPLOT.Name = "wfgPLOT";
this.wfgPLOT.Plots.AddRange(new NationalInstruments.UI.WaveformPlot[] {
this.waveformPlot1});
this.wfgPLOT.Size = new System.Drawing.Size(754, 337);
this.wfgPLOT.TabIndex = 15;
this.wfgPLOT.UseColorGenerator = true;
this.wfgPLOT.XAxes.AddRange(new NationalInstruments.UI.XAxis[] {
this.xAxis1});
this.wfgPLOT.YAxes.AddRange(new NationalInstruments.UI.YAxis[] {
this.yAxis1});
//
// waveformPlot1
//
this.waveformPlot1.XAxis = this.xAxis1;
this.waveformPlot1.YAxis = this.yAxis1;
//
// xAxis1
//
this.xAxis1.Caption = "Number of Readings";
//
// yAxis1
//
this.yAxis1.Caption = "Measured Value";
Thus the following code provided the solution.
// modifying default wave form graph Axis Caption follows
wfgPLOT.Caption = sTableName;
xAxis1.Caption = plotXlbl;
yAxis1.Caption = plotYlbl;
Thanks Again
Craig