GObject.Type.Rectangle

Rectangle

Description

Задаёт графическому объекту тип «Прямоугольник»

Example

// set the name of the object 
let RectangleObjectName = "MyRectangleObject";
// check if an object with the same name already exists 
let OurRectangleObject = this.getObject(RectangleObjectName);
// if doesn't exist 
if (!OurRectangleObject) {
     // then we create such an object and set its parameters 
     OurRectangleObject = this.createObject(GObject.Type.Rectangle, RectangleObjectName)
         // set the coordinates of the first corner 
         .setTime1(Time[1])
         .setPrice1(Low[1])
         // задаём координаты второго угла – противоположного первому по диагонали
         .setTime2(Time[20])
         .setPrice2(Low[20])
         // задаём цвет линии прямоугольника
         .setColor(Color.MediumVioletRed);
}