module Rubyvis # Alias for Rubyvis::Label def self.Label Rubyvis::Label end # Represents a text label, allowing textual annotation of other marks or # arbitrary text within the visualization. The character data must be plain # text (unicode), though the text can be styled using the {@link #font} # property. If rich text is needed, external HTML elements can be overlaid on # the canvas by hand. # #
Labels are positioned using the box model, similarly to {@link Dot}. Thus, # a label has no width or height, but merely a text anchor location. The text # is positioned relative to this anchor location based on the # text_align, text_baseline and text_margin properties. # Furthermore, the text may be rotated using text_angle class Label < Mark @properties=Mark.properties.dup ## # :attr: text # The character data to render; a string. The default value of the text # property is the identity function, meaning the label's associated datum will # be rendered using its to_s() ## # :attr: font # The font format, per the CSS Level 2 specification. The default font is "10px # sans-serif", for consistency with the HTML 5 canvas element specification. # Note that since text is not wrapped, any line-height property will be # ignored. The other font-style, font-variant, font-weight, font-size and # font-family properties are supported. # # @see {CSS2 fonts}[http://www.w3.org/TR/CSS2/fonts.html#font-shorthand] ## # :attr: text_angle # The rotation angle, in radians. Text is rotated clockwise relative to the # anchor location. For example, with the default left alignment, an angle of # Math.PI / 2 causes text to proceed downwards. The default angle is zero. ## # :attr: text_style # The text color. The name "text_style" is used for consistency with "fill_style" # and "stroke_style", although it might be better to rename this property (and # perhaps use the same name as "stroke_style"). The default color is black. # See Rubyvis.color() ## # :attr: text_align # The horizontal text alignment. One of: