Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

ScatterGraph background color with templates

Solved!
Go to solution

Hello,

 

I've a scatter graph with a plot and two templates plots.

I would like to get a color outside those plots like the pink color on the picture.

 

How to do the trick ?

 

Thanks.

Flow

Sans titre.png

 

 

 

 

0 Kudos
Message 1 of 6
(2,689 Views)

Hi Flow,

 

I am assuming you would like this in LabVIEW if so, see below:

You could use the Fill Base Line option by right-clicking the Plot legend and select the option 'infinity'. 

 

 

Thanks,

Shezan Nabiel

0 Kudos
Message 2 of 6
(2,551 Views)

Hi Flow,

 

I am assuming you would like this in LabVIEW if so, see below:

You could use the Fill Base Line option by right-clicking the Plot legend and select the option 'infinity'. 

 

graph example.JPG

 

You can also do this programmatically by adding a property node by right clicking the graph and following this:

 

prop op2.png

 

You will need to add a constant value to the property node, see the context help for more info:

 

 

prop.JPG

 

I have added an example for LabVIEW 2018, let me know if you need it for another version.

 

Thanks,

Shezan Nabiel

0 Kudos
Message 3 of 6
(2,528 Views)

Hello,

 

Thank you for your answers.

Unfortunatly I use the MeasurementStudio library in C#. using the scattergraph object.

 

I didn't use Labview software.

 

Flo.

0 Kudos
Message 4 of 6
(2,524 Views)

Hi Flow,

 

If you send me a basic example of your code, I could try edit & develop an example for you in C#.

 

Thank you

Shezan Nabiel

0 Kudos
Message 5 of 6
(2,520 Views)
Solution
Accepted by topic author Flow75

Sans titre.jpg

 

ahhhh just find out my solution.

 

Thank you very much for your help.

 

 

For information, the solution :

 

 

this.scatterGraph1 = new NationalInstruments.UI.WindowsForms.ScatterGraph();
this.xAxis1 = new NationalInstruments.UI.XAxis();
this.yAxis1 = new NationalInstruments.UI.YAxis();
this.scatterPlot1 = new NationalInstruments.UI.ScatterPlot();
this.scatterPlot2 = new NationalInstruments.UI.ScatterPlot();
((System.ComponentModel.ISupportInitialize)(this.scatterGraph1)).BeginInit();
this.SuspendLayout();
//
// scatterGraph1
//
this.scatterGraph1.Dock = System.Windows.Forms.DockStyle.Fill;
this.scatterGraph1.Location = new System.Drawing.Point(0, 0);
this.scatterGraph1.Name = "scatterGraph1";
this.scatterGraph1.Plots.AddRange(new NationalInstruments.UI.ScatterPlot[] {
this.scatterPlot1,
this.scatterPlot2});
this.scatterGraph1.Size = new System.Drawing.Size(428, 391);
this.scatterGraph1.TabIndex = 0;
this.scatterGraph1.UseColorGenerator = true;
this.scatterGraph1.XAxes.AddRange(new NationalInstruments.UI.XAxis[] {
this.xAxis1});
this.scatterGraph1.YAxes.AddRange(new NationalInstruments.UI.YAxis[] {
this.yAxis1});
//
// scatterPlot1
//
this.scatterPlot1.BasePlot = this.scatterPlot2;
this.scatterPlot1.FillBase = NationalInstruments.UI.XYPlotFillBase.Plot;
this.scatterPlot1.FillMode = NationalInstruments.UI.PlotFillMode.Fill;
this.scatterPlot1.XAxis = this.xAxis1;
this.scatterPlot1.YAxis = this.yAxis1;
//
// scatterPlot2
//
this.scatterPlot2.BasePlot = this.scatterPlot1;
this.scatterPlot2.FillBase = NationalInstruments.UI.XYPlotFillBase.Plot;
this.scatterPlot2.XAxis = this.xAxis1;
this.scatterPlot2.YAxis = this.yAxis1;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(428, 391);
this.Controls.Add(this.scatterGraph1);
this.Name = "Form1";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.scatterGraph1)).EndInit();
this.ResumeLayout(false);

 

0 Kudos
Message 6 of 6
(2,499 Views)