IDMAxis3 Interface

Version: 3.1
Dispatch interface for DMAxis Object

GUID: {673AAE04-9A0B-11D4-B2A4-FD6847C75367}

This interface provides access to the plot axes properties. You may change axis coordinate range by using Min and Max properties, or set AutoScale=true to calculate coordinate range automatically so that all points will be visible. Use other properties to show or hide appropriate axis elements or to change their visual attributes.

Members:
Kind Name ID Description
Min 1 Change TAxis.Min
Max 2 Change TAxis.Max
Margins 3 Change TAxis.Margins
AutoScale 4 Change TAxis.AutoScale
Title 5 Change TAxis.Title
Expression 6 Change TAxis.Expression
IsVisible 101 Control axis visibility
GridVisible 102 Change grid lines visibility
LabelVisible 103 Change ticks and labels visibility
MajorTicks 104 Change TAxis.MajorTicks
MinorTicks 105 Change TAxis.MinorTicks
TickStyle 106 Change ticks layout
Color -501 Change axis color
Font -512 Change axis labels font
Format 107 Change labels format
Document 108 Returns owner document object
LineWidth 201 Changes axis line width
TitleMargin 202 Changes distance in pixels between axis line and title
LabelMargin 203 Changes distance in pixels between axis line and labels
TickLength 204 Relative tick length (1-font height)
TicksVisible 205 Controls axis ticks visibility
InnerTicks 206 If true, ticks painted inside axis frame
IsLinked 207 If true, axis labels depend on parallel axis scale
ExpressionVisible 208 If true, expression painted in axis title (if title is not empty)
FontColor 209 Changes axis font color
GridColor 210 Changes grid lines color
GridLineWidth 211 Changes grid line width
GridLineType 212 Changes grid line type
AssignObject 213 Copies all attributes from the given axis

Syntax:
property Min: Double

Applies to:
DMAxis, DMFloatEdit, DMSerie, DMSpinEdit

For DMAxis, Min define minimal value of the axis range. Note: if you want to fix axis range you have to clear AutoScale flag. Also keep in mind that in DM2003 Min may be greater than Max.

For DMSerie, this property allows you to change minimal limit of the parameter ("cx") for parameterized (or functional) series.

For DMSpinEdit and DMFloatEdit ActiveX controls, it defines minimal possible value of the Value property.

Syntax:
property Max: Double

Applies to:
DMAxis, DMFloatEdit, DMSerie, DMSpinEdit

For DMAxis, Max defines maximal value of the axis range. Note: if you want to fix axis range you have to clear AutoScale flag. Also keep in mind that in DM2003 Min may be greater than Max.

For DMSerie, this property allows you to change maximal limit of the parameter ("cx") for parameterized (or functional) series.

For DMSpinEdit and DMFloatEdit ActiveX controls, it defines maximal possible value of the Value property.

Syntax:
property Margins: Double

Applies to:
DMAxis

Margins defines the distance between axis ranges given by Min, Max values and calculated by series data. Value of 0.1 corresponds to approximately 10% blank space. This property should be used in conjunction with AutoScale.

Syntax:
property AutoScale: Boolean

Applies to:
DMAxis

If this flag set to true, every time when plot will be repainted new axis range will be automatically calculated. All nonempty series take part in autoscaling.

Syntax:
property Title: BSTR

Applies to:
DMAxis

Axis may have a title. If this property is not empty, axis title will be visible. Note that not all fonts are displayed properly in the vertical direction!

Syntax:
property Expression: BSTR

Applies to:
DMAxis, DMFitter, DMWorksheet, LMFitter

For DM2003 plot axis, you may transform all series simultaneously if you assign valid expression to this property. See details about expression syntax and allowed arguments and function names.

For DMFitter ActiveX control, Expression property should be defined before you start fitting. There are several possible situations:


For worksheets, this property is index-based and determine column expressions. These expressions may be used to recalculate dynamically the contents of appropriate column. Notice that you can assign expressions to any column, even those that has no data! The syntax and parameter set for column expressions are the same as for plot series.

Example:

Server.CreateDocument Server.InstallPath & "samples\data_1.dat"
Server.ExecuteCommand "ShowWorksheetAction"
Server.ActiveDocument.Worksheet.Expression(3)="a+b"

Syntax:
property IsVisible: Boolean

Applies to:
CoCPortLib2, CPortLibX2, DMAxis, DMClientSocket, DMComboBox, DMComPort, DMComTerminal, DMDigitizer, DMExpressionComboBox, DMFloatEdit, DMIEEE488Port, DMLabel, DMListBox, DMSerie, DMSpinEdit

IsVisible property determines whether appropriate object is visible on the screen. Note that for ActiveX controls embedded in the HTML page, you can also change Object.style.visibility property. Some controls like DMClientSocket, DMIEEE488Port and DMComPort are invisible by design and don't implement this property.

Syntax:
property GridVisible: Boolean

Applies to:
DMAxis

Syntax:
property LabelVisible: Boolean

Applies to:
DMAxis

Syntax:
property MajorTicks: Long

Applies to:
DMAxis

Syntax:
property MinorTicks: Long

Applies to:
DMAxis

Syntax:
property TickStyle: User_Defined

Applies to:
DMAxis

TickStyle property determines axis major ticks positions. Possible values of this property listed in the AxisTicksType enumeration.

Syntax:
property Color: User_Defined

Applies to:
DMAxis, DMComboBox, DMDigitizer, DMExpressionComboBox, DMFloatEdit, DMLabel, DMListBox, DMPlot, DMSerie, DMSpinEdit, DMWorksheet

This property should be used to change color of the selected object.

Syntax:
property Font: PTR

Applies to:
DMAxis, DMComboBox, DMExpressionComboBox, DMFloatEdit, DMLabel, DMListBox, DMSpinEdit, DMWorksheet

This property should be used to change font of the selected object. It returns reference to the special IFontDisp interface pointer. See Microsoft OLE documentation for more details.

Example:

 
Server.ActiveDocument.Worksheet.Font.Name
Server.ActiveDocument.Worksheet.Font.Size
Server.ActiveDocument.Worksheet.Font.Bold
Server.ActiveDocument.Worksheet.Font.Italic
Server.ActiveDocument.Worksheet.Font.Underline
Server.ActiveDocument.Worksheet.Font.Strikethrough
Server.ActiveDocument.Worksheet.Font.Weight
Server.ActiveDocument.Worksheet.Font.Charset
Server.ActiveDocument.Worksheet.Font.Color 'absent!

Syntax:
property Format: BSTR

Applies to:
DMAxis, DMFloatEdit, DMSpinEdit, DMWorksheet

This property allows you to change numeric format. Possible values are: XX.Yt, where XX - total number of digits, Y - number of digits after decimal point, t - one of the following characters:

Another type of strings used for Date and Time format feature. If format specifier value enclosed in the curly brackets, it is treated as date/time.

Syntax:
r/o property Document: IDispatch

Applies to:
DMAxis, DMContainer, DMLabel, DMPlot, DMSerie, DMWorksheet

Document property returns DMDocument object which is an owner of the given object. So that, you don't need to cycle through the object collections to determine the object's owner. Keep in mind that in DM, VCL objects may be destroyed while appropriate COM objects still alive since their lifecycle is governed by reference counting mechanism. Such COM objects with killed VCL owner become a "zombie" - they have no actual data, their methods do nothing and properties return empty data.

Examples:

sub TestSerie
dim Serie
  if Server.ActiveDocument is Nothing then
    MsgBox "NULL document"
  else
    set Serie=Server.ActiveDocument.Plot.CurrentSerie
    MsgBox Serie.Document.WindowCaption  
  end if
end sub

sub TestAxis
dim Axis
  set Axis=Server.ActiveDocument.Plot.XAxis2
  MsgBox Axis.Document.WindowCaption
end sub

sub TestContainer
dim Container
  set Container=Server.ActiveDocument.Container
  MsgBox Container.Document.WindowCaption
end sub

sub TestPlot
dim Plot
  set Plot=Server.ActiveDocument.Plot
  MsgBox Plot.Document.WindowCaption
end sub

sub TestWorksheet
dim Worksheet
  set Worksheet=Server.ActiveDocument.Worksheet
  MsgBox Worksheet.Document.WindowCaption
end sub

dim Worksheet1
set Worksheet1=Server.ActiveDocument.Worksheet

sub TestWorksheet1
  MsgBox Worksheet1.Document.WindowCaption
end sub

dim Serie1
set Serie1=Server.ActiveDocument.Plot.CurrentSerie

sub TestSerie1
  if Serie1.Document is Nothing then
    MsgBox "NULL document"
  else
    MsgBox Serie1.Document.WindowCaption  
  end if
end sub

Syntax:
property LineWidth: Long

Applies to:
DMAxis, DMLabel, DMSerie

LineWidth property determines the width of object's line or contour.

Syntax:
property TitleMargin: Long

Applies to:
DMAxis

TitleMargin property determines the distance between plot axis and Title text, in pixels. It is used only if IDMPlot3.AutoSizeMargins property is set to True.

Syntax:
property LabelMargin: Long

Applies to:
DMAxis

LabelMargin property determines the distance between plot axis and tick labels, in pixels. It is used only if IDMPlot3.AutoSizeMargins property is set to True.

Syntax:
property TickLength: Double

Applies to:
DMAxis

TickLength determines major (and minor) ticks length relative to the size of tick labels font.

Syntax:
property TicksVisible: Boolean

Applies to:
DMAxis

Syntax:
property InnerTicks: Boolean

Applies to:
DMAxis

Syntax:
property IsLinked: Boolean

Applies to:
DMAxis

If this flag is set, axis scale is linked to another axis of the same direction (X or Y). In this mode, axis serves as an additional visual marker, and its labels calculated by the values of labels in paired axis and by its Expression. Typical use of this mode includes scaling factors (inches and centimeters), or reverse scale (1/T - T, Hz - 1/cm).

Syntax:
property ExpressionVisible: Boolean

Applies to:
DMAxis

Syntax:
property FontColor: User_Defined

Applies to:
DMAxis, DMLabel, DMWorksheet

Use FontColor property to change font color for worksheets, plot axes and labels. Unlike VCL objects, IFont interface has no Color property so it has to be implemented separately.

Syntax:
property GridColor: User_Defined

Applies to:
DMAxis

Syntax:
property GridLineWidth: Long

Applies to:
DMAxis

Syntax:
property GridLineType: User_Defined

Applies to:
DMAxis

This property determines grid line type. Possible values listed in the PlotLineType enumeration.

Syntax:
function AssignObject(Value): VOID

Applies to:
DMAxis, DMLabel, DMSerie, DMWorksheet

AssignObject method allows to quickly copy all properties of axis, series, label or worksheet. In the first 3 cases it is just a wrapper for appropriate VCL method; worksheet copies only those properties that affect visual appearance and may be changed (by user interface or programmatically). It is especially useful when you need to clone separate objects in the data window.

Notice that DMLabel object also can assign DMPlot objects, in this case rectangular label will display plot as a metafile.

Examples:

sub worksheet_assign_test
dim sw, dw
  if Server.DocumentCount=0 then exit sub
  set sw=Server.ActiveDocument
  set dw=Server.CreateDocument("")
  call dw.Worksheet.AssignObject(sw.Worksheet)
  dw.WindowState=0
end sub

sub axis_ser_lbl_assign_test
' note: source window must have series and labels!
dim sw, dw
  if Server.DocumentCount=0 then exit sub
  set sw=Server.ActiveDocument
  set dw=Server.CreateDocument("")
  call dw.Plot.XAxis.AssignObject(sw.Plot.XAxis)
  call dw.Plot.YAxis.AssignObject(sw.Plot.YAxis)
  dw.Plot.Series(0).AssignObject sw.Plot.Series(2)
  dw.Plot.Labels.AddItem.AssignObject sw.Plot.Labels(0)
  dw.WindowState=1
end sub

sub lbl_assign_plot_self
dim doc, lbl
  set doc= server.CreateDocument("")
  doc.WindowState=1
  set lbl=doc.Plot.Labels.AddItem
  lbl.LabelKind=pltRectangle
  lbl.XMin=doc.Plot.XAxis.Min
  lbl.YMin=doc.Plot.YAxis.Min
  lbl.XMax=doc.Plot.XAxis.Max/2
  lbl.YMax=doc.Plot.YAxis.Max/2
  lbl.AssignObject doc.Plot
end sub