WAPlots.CreatePlot: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 3: Line 3:


<onlyinclude>Returns a bitmap object that represents the plot. (VB.NET only)</onlyinclude>
<onlyinclude>Returns a bitmap object that represents the plot. (VB.NET only)</onlyinclude>
The data set must first be analyzed (with either the [[WeibullDataSet.Calculate]] or [[ALTADataSet.Calculate]] method) before it can be plotted.


== Syntax ==
== Syntax ==
Line 25: Line 27:
   
   
  {{APIComment|'Declare a WeibullDataSet object.}}
  {{APIComment|'Declare a WeibullDataSet object.}}
  {{APIPrefix|Dim}} WDS {{APIPrefix|As New}} WeibullDataSet
  {{APIPrefix|Dim}} WDS {{APIPrefix|As New}} WeibullDataSet
    
    
  {{APIComment|'Add failures to the data set.}}
  {{APIComment|'Add failures to the data set.}}
  WDS.AddFailure(1, 1)
  WDS.AddFailure(1, 1)
  WDS.AddFailure(2, 1)
  WDS.AddFailure(2, 1)
  WDS.AddFailure(3, 1)
  WDS.AddFailure(3, 1)
    
    
{{APIComment|'Fit the data to the life distribution, using all default analysis settings.}} 
  WDS.Calculate
  {{APIComment|'Create a WAPlots object.}}  
  {{APIComment|'Create a WAPlots object.}}  
  {{APIPrefix|Dim}} MyPlot {{APIPrefix|As New}} WAPlots
  {{APIPrefix|Dim}} MyPlot {{APIPrefix|As New}} WAPlots
   
   
  {{APIComment|'Add the data set to the plot.}}
  {{APIComment|'Add the calculated data set to the plot.}}
  MyPlot.AddDataset(WDS)
  MyPlot.AddDataset(WDS)
   
   
  {{APIComment|'Create a Probability plot.}}
  {{APIComment|'Create a Probability plot and display it. This example assumes that a picture box control called "PictureBox1"}}
  {{APIPrefix|Dim}} FinalPlot {{APIPrefix|As}} Bitmap = MyPlot.CreatePlot(WAPlotType.Probability)
{{APIComment|'already exists in the project.}}
  PictureBox1.Image = MyPlot.CreatePlot(WAPlotType.Probability)

Revision as of 16:30, 20 April 2016

APIWiki.png


Member of: SynthesisAPI.WAPlots


Returns a bitmap object that represents the plot. (VB.NET only)

The data set must first be analyzed (with either the WeibullDataSet.Calculate or ALTADataSet.Calculate method) before it can be plotted.

Syntax

.CreatePlot(PlotType, UserSettings, Width, Height)

Parameters

PlotType

Required. The type of plot to create. Can be any WAPlotType constant.

UserSettings

Optional. The WAPlotSettings object that represents the plot's settings.

Width

Optional. Integer. The plot width. Default value = 1150 pixels.

Height

Optional. Integer. The plot height. Default value = 800 pixels.

Example

VB.NET

 'Declare a WeibullDataSet object. 
  Dim WDS As New WeibullDataSet
 
 'Add failures to the data set. 
  WDS.AddFailure(1, 1)
  WDS.AddFailure(2, 1)
  WDS.AddFailure(3, 1)
 
 'Fit the data to the life distribution, using all default analysis settings.   
  WDS.Calculate

 'Create a WAPlots object.  
  Dim MyPlot As New WAPlots

 'Add the calculated data set to the plot. 
  MyPlot.AddDataset(WDS)

 'Create a Probability plot and display it. This example assumes that a picture box control called "PictureBox1" 
 'already exists in the project. 
  PictureBox1.Image = MyPlot.CreatePlot(WAPlotType.Probability)