WAPlots.CreatePlot: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Template:APIClass|WAPlots Class|WAPlots}}
{{Template:API}}{{Template:APIBreadcrumb|.[[WAPlots_Class|WAPlots]]}}
{{Template:WAPlots.CreatePlot.Cmt}}


== Syntax ==
*CreatePlot( PlotType {{APIPrefix|As}} [[WAPlotType Enumeration|WAPlotType]], {{APIPrefix|Optional}} UserSettings {{APIPrefix|As}} [[WAPlotSettings Class|WAPlotSettings ]] = {{APIPrefix|Nothing}} , {{APIPrefix|Optional}} Width {{APIPrefix|As Integer}} = 1150, {{APIPrefix|Optional }} Height {{APIPrefix|As Integer}} = 800) {{APIPrefix|As System.Drawing.Bitmap}}


Parameters
<onlyinclude>Returns a bitmap object that represents the plot. (.NET only)</onlyinclude>
:''PlotType'': The plot type, specified with the [[WAPlotType Enumeration|WAPlotType]] enumeration.


:''UserSettings'': The plot settings, specified as a [[WAPlotSettings Class|WAPlotSettings]] object.
== Syntax ==
 
'''.CreatePlot'''(''PlotType'', ''UserSettings'', ''Width'', ''Height'')
:''Width'': The width, in pixels, of the finished plot.


:''Height'': The height, in pixels, of the finished plot.
===Parameters===
''PlotType''
:Required. The type of plot to create. Can be any [[WAPlotType Enumeration|WAPlotType]] constant.


== Usage Example ==
''UserSettings''
{{APIComment|Create a new Weibull/ALTA Plot instance.}}
:Optional. The [[WAPlotSettings Class|WAPlotSettings ]] object that represents the plot's settings.  
        Dim WeibullALTAPlot As New WAPlots


{{APIComment|Declare a WeibullDataSet. See [[New WeibullDataSet]] for additional details.}}
''Width''
        Dim WDS As New WeibullDataSet
:Optional. Integer. The plot width. Default value = 1150 pixels.


{{APIComment|Add values to the raw data. See [[WeibullDataSet.AddFailure|AddFailure]] for additional details.}}
''Height''
        WDS.AddFailure(1, 1)
:Optional. Integer. The plot height. Default value = 800 pixels.
        WDS.AddFailure(2, 1)
        WDS.AddFailure(3, 1)


{{APIComment|Calculate the WeibullDataSet. See [[WeibullDataSet.CalculateBestFit|CalculateBestFit]] for additional details.}}
== Example ==
        WDS.Calculate
To create a plot, you must first add an object to the plot:
*Use the [[WAPlots.AddDataset]] method to add either a calculated [[WeibullDataSet Class|WeibullDataSet]] or [[ALTADataSet Class|ALTADataSet]] object.
:OR
*Use the [[WAPlots.AddModel]] method to add a [[CModel Class|cModel]] object.  


{{APIComment|Add the WeibullDataSet to the WAPlots.}}
        WeibullALTAPlot.AddDataset(WDS)


{{APIComment|Create the WAPlotIn this example, it will create a Probability plot.}}
The following example uses a <code>WeibullDataSet</code> object to create the plot.
        Dim FinalPlot As Bitmap = WeibullALTAPlot.CreatePlot(WAPlotType.Probability)
 
'''VB.NET'''
 
{{APIComment|'Declare a WeibullDataSet object.}}
  {{APIPrefix|Dim}} WDS {{APIPrefix|As New}} WeibullDataSet
 
{{APIComment|'Add failures to the data set.}}
  WDS.AddFailure(1, 1)
  WDS.AddFailure(2, 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.}}
  {{APIPrefix|Dim}} MyPlot {{APIPrefix|As New}} WAPlots
{{APIComment|'Add the calculated data set to the plot.}}
  MyPlot.AddDataset(WDS)
  {{APIComment|'Create a Probability plot and display it. This example assumes that a PictureBox control called "PictureBox1"}}
{{APIComment|'already exists in the Windows Form project.}}
  PictureBox1.Image = MyPlot.CreatePlot(WAPlotType.Probability)

Latest revision as of 15:11, 3 August 2017

APIWiki.png


Member of: SynthesisAPI.WAPlots


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

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

To create a plot, you must first add an object to the plot:

OR


The following example uses a WeibullDataSet object to create the plot.

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 PictureBox control called "PictureBox1" 
 'already exists in the Windows Form project. 
  PictureBox1.Image = MyPlot.CreatePlot(WAPlotType.Probability)