g.js — graphical objects for JavaScript

texttext

Create a text element.

g.text('Hello, world!', {x: 0, y: 0}, 'sans-serif', 20, 'center');

Parameters

  • text: Text to be displayed.be visualised as text.
  • position: The position of the text.
  • fontFamily: The font of the text.
  • fontSize: The size of the text.
  • textAlign: The horizontal alignment of the text (left, right or center).

See Also