WAPlots.CreatePlotVB6: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
m (Protected "WAPlots.CreatePlotVB6" ([edit=sysop] (indefinite) [move=sysop] (indefinite)) [cascading])
No edit summary
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Template:APIClass|WAPlots Class|WAPlots}}
{{Template:API}}{{Template:APIBreadcrumb|.[[WAPlots_Class|WAPlots]]}}


Create the plot based on the WeibullDataSet and/or the ALTADataSets entered into the WAPlots.  Returns an IPicture object of the plot for VBA/VB6.


== Method Syntax ==
<onlyinclude>Returns a bitmap object that represents the plot. (VBA/VB6 only.)</onlyinclude>
{{APIName|CreatePlotVB6(}}
{{APIPrefix|ByVal}}
{{APIName|PlotType}}
{{APIPrefix|As}}
{{APIName|[[WAPlotType]],}}
{{APIPrefix|Optional ByVal}}
{{APIName|UserSettings}}
{{APIPrefix|As}}
{{APIName|[[WAPlotSettings]]}}
=
{{APIPrefix|Nothing}}
{{APIName|,}}
{{APIPrefix|Optional ByVal}}
{{APIName|Width}}
{{APIPrefix|As Integer}}
=
{{APIName|1150,}}
{{APIPrefix|Optional ByVal}}
{{APIName|Height}}
{{APIPrefix|As Integer}}
=
{{APIName|800)}}
{{APIPrefix|As Object}}


{{APIComment|Creates a IPicture image object containing the plot image.}}
== Syntax ==
'''.CreatePlotVB6'''(''PlotType'', ''UserSettings'', ''Width'', ''Height'')


== Parameters ==
===Parameters===
'''PlotType'''
''PlotType''
Set the type of plot desired, of the [[WAPlotType]] enum.
:Required. The type of plot to create. Can be any [[WAPlotType Enumeration|WAPlotType]] constant.


'''UserSettings'''
''UserSettings''
Sets the plot settings via an instance of the [[WAPlotSettings]] class.
:Optional. The [[WAPlotSettings Class|WAPlotSettings ]] object that represents the plot's settings.  


'''Width'''
''Width''
Set the width, in pixels, of the finished plot.
:Optional. Integer. The plot width. Default value = 1150 pixels.


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


== Usage Example ==
== Example ==
{{APIComment|Create a new Weibull/ALTA Plot instance.}}
To create a plot, you must first add an object to the plot:
        Dim WeibullALTAPlot As New WAPlots
*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|Declare a WeibullDataSet. See [[New WeibullDataSet]] for additional details.}}
        Dim WDS As New WeibullDataSet


{{APIComment|Add values to the raw data. See [[WeibullDataSet.AddFailure]] for additional details.}}
The following example uses a <code>WeibullDataSet</code> object to create the plot.
        WDS.AddFailure(1, 1)
        WDS.AddFailure(2, 1)
        WDS.AddFailure(3, 1)


{{APIComment|Calculate the WeibullDataSet.}}
'''VBA'''
        WDS.Calculate
 
{{APIComment|'Declare a WeibullDataSet object.}}
{{APIComment|Add the WeibullDataSet to the WAPlots.}}
  {{APIPrefix|Dim}} WDS {{APIPrefix|As New}} WeibullDataSet
        WeibullALTAPlot.AddDataset(WDS)
 
 
{{APIComment|'Add failures to the data set.}}
{{APIComment|Create the WAPlot.  In this example, it will create a Probability plot.}}
  {{APIPrefix|Call}} WDS.AddFailure(1, 1)
        Dim FinalPlot As Bitmap = WeibullALTAPlot.CreatePlotVB6(WAPlotType.Probability)
  {{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 control called "Image1"}}
{{APIComment|'already exists in the active Excel sheet.}}
  {{APIPrefix|Set}} Image1.Picture = MyPlot.CreatePlotVB6(WAPlotType_Probability)

Latest revision as of 16:29, 24 June 2016

APIWiki.png


Member of: SynthesisAPI.WAPlots


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

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

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.

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 control called "Image1" 
 'already exists in the active Excel sheet. 
 Set Image1.Picture = MyPlot.CreatePlotVB6(WAPlotType_Probability)