Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Text

This is a DisplayObject. Represents some text to be rendered. When rendered in the global space, Text can be used as a label.

 ...
//in this example map returns a global text label at the last bar's
//index on the X-axis and 40 pixels above the price 3850 in the Y-axis.
 map(d) {
     return {
         graphics: d.isLast() && {
             items: [
                 {
                     tag: 'Text',
                     key: 'myLabel',
                     point: {
                         x: du(d.index()),
                         y: op(du(3850), '-', px(40))
                     },
                     text: '-> 3850',
                     style: { fontSize: 18, fontWeight: "bold", fill: '#f00' },
                     textAlignment: 'centerMiddle',
                     global: true //<- indicates this is a globally-scoped object
                 }
             ]
         }
     }
 }

Hierarchy

  • Text

Properties

key: string

The graphic element's render key, like an HTML id attribute.

point: Point

The origin point of the element.

style: TextStyle

An Object with one optional property, color.

tag: "Text"
text: string

The text string to display.

textAlignment: TextAlignmentEnum

Any of the valid TextAlignmentEnum values.

Generated using TypeDoc