WAPlots.CreatePlotVB6: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{Template:APIClass|WAPlots Class|WAPlots}}
{{Template:API}}{{Template:APIBreadcrumb|.[[WAPlots_Class|WAPlots]]}}
{{Template:WAPlots.CreatePlotVB6.Cmt}}
 
 
<onlyinclude>Returns a bitmap object that represents the plot. (VBA/VB6 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 ==
*CreatePlotVB6( 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 Object}}
'''.CreatePlotVB6'''(''PlotType'', ''UserSettings'', ''Width'', ''Height'')
 
===Parameters===
''PlotType''
:Required. The type of plot to create. Can be any [[WAPlotType Enumeration|WAPlotType]] constant.


Parameters
''UserSettings''
:''PlotType'': The plot type, specified with the [[WAPlotType Enumeration|WAPlotType]] enumeration.
:Optional. The [[WAPlotSettings Class|WAPlotSettings ]] object that represents the plot's settings.  


:''UserSettings'': The plot settings, specified as a [[WAPlotSettings Class|WAPlotSettings]] object.
''Width''
:Optional. Integer. The plot width. Default value = 1150 pixels.


:''Width'': The width, in pixels, of the finished plot.
''Height''
:Optional. Integer. The plot height. Default value = 800 pixels.


:''Height'': The height, in pixels, of the finished plot.
== Example ==


== Usage Example ==
  '''VBA'''
  {{APIComment|'Create a new WAPlots object.}}
  Dim WeibullALTAPlot As New WAPlots
  {{APIComment|'Declare a WeibullDataSet object.}}
 
   {{APIPrefix|Dim}} WDS {{APIPrefix|As New}} WeibullDataSet
  {{APIComment|'Declare a WeibullDataSet. See [[WeibullDataSet Class|WeibullDataSet]].}}
   Dim WDS As New WeibullDataSet
 
{{APIComment|'Add values to the raw data. See [[WeibullDataSet.AddFailure]].}}
  WDS.AddFailure(1, 1)
  WDS.AddFailure(2, 1)
  WDS.AddFailure(3, 1)
 
{{APIComment|'Calculate the WeibullDataSet.}}
  WDS.Calculate
 
{{APIComment|'Add the WeibullDataSet to the WAPlots objects.}}
  WeibullALTAPlot.AddDataset(WDS)
    
    
  {{APIComment|'Create the WAPlotIn this example, it will create a Probability plot.}}
{{APIComment|'Add failures to the data set.}}
   Dim FinalPlot As Bitmap = WeibullALTAPlot.CreatePlotVB6(WAPlotType.Probability)
  {{APIPrefix|Call}} WDS.AddFailure(1, 1)
  {{APIPrefix|Call}} WDS.AddFailure(2, 1)
  {{APIPrefix|Call}} 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.}}
  {{APIPrefix|Call}} MyPlot.AddDataset(WDS)
  {{APIComment|'Create a Probability plot and display it. This example assumes that an image object called "Image1"}}
{{APIComment|'already exists in the active Excel sheet.}}
   {{APIPrefix|Set}} Image1.Picture = MyPlot.CreatePlotVB6(WAPlotType_Probability)

Revision as of 16:19, 20 April 2016

APIWiki.png


Member of: SynthesisAPI.WAPlots


Returns a bitmap object that represents the plot. (VBA/VB6 only.)

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

Syntax

.CreatePlotVB6(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

VBA

 'Declare a WeibullDataSet object. 
 Dim WDS As New WeibullDataSet
 
 'Add failures to the data set. 
 Call WDS.AddFailure(1, 1)
 Call WDS.AddFailure(2, 1)
 Call 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. 
 Call MyPlot.AddDataset(WDS)

 'Create a Probability plot and display it. This example assumes that an image object called "Image1" 
 'already exists in the active Excel sheet. 
 Set Image1.Picture = MyPlot.CreatePlotVB6(WAPlotType_Probability)