Syntax
Public Function CreateObjectLabel(chart_ID As Long, nwin As Long, name As String, XPos As Long, YPos As Long, text As String) As Boolean
Description
This function is used to create a label object on the chart at a specific position.
Parameters
Key | Description |
chart_ID | Chart identifier, 0 is the current chart, the value of type Long. |
nwin | Chart subwindow, the value of type Long. |
name | Object Key, the value of type String. |
XPos | The X-axis point, the value of type Long |
YPos | The Y-axis point, the value of type Long. |
text | Label object content, the value of type String. |
Return value
Returns true if the object is created. Otherwise returns false. In order to get an error, call GetLastError() function.
Sample
Dim objTextDim objIDDim XPosDim YPosPublic Sub main() If AccountInfoInteger(ACCOUNT_LOGIN) = -1 Then ' Check if account is selected AlertMessage "Please select an account first" Else objID = "lblText" ' ID of the object XPos = 10 ' X position on chart YPos = 180 ' Y position on chart objText="Text goes here." ' Sets the text of the label. CreateObjectLabel 0,0,CSTR(objID),CINT(XPos),CINT(YPos),objText 'Creates the label with the selected parametersEnd IfEnd Sub
See Also