LegendOptions class (Graph)

LegendOptions()

new LegendOptions()

The LegendOptions object defines the configuration options to display the view's legend (the legend helps you choose which series to show or hide at runtime)

For instance, the "visible" option:

legend: { visible: true }
shows the legend
LegendOptions

Members

(static) align :Graph.LegendAlignEnum

The align field specifies the alignment of the legend's content.
Type:
Example
null {null} or exontrol.Graph.LegendAlignEnum.exCenter or 1 {number}, by default, centers the legend's content
 "start" {string} or exontrol.Graph.LegendAlignEnum.exStart or 0 {number}, the legend's content is aligned to the start (left or top side of the view)
align

(static) dock :Graph.PanelDockEnum

The dock field specifies the edge of the container the legend-window is anchored to.
Type:
Example
null {null}, by default, the legend is anchored to the bottom-side of the view
 "left" {string} or exontrol.Graph.PanelDockEnum.exLeft or 3 {number}, the legend is docked to the left side of the control
dock

(static) flow :Graph.LegendFlowEnum

The flow field determines whether the legend objects are arranged from left to right or top to bottom.
Type:
Example
null {null} or exontrol.Graph.LegendFlowEnum.exLeftToRight or 0 {number}, by default, the legend objects are aligned left to right while the legend panel is anchored to the top or bottom side of the view. Otherwise, the legend objects are vertically arranged.
 "top" {string} or exontrol.Graph.PanelDockEnum.exTopToBottom or 1 {number}, indicates that the next legend object gets arranged to the bottom of the current legend object
flow

(static) formatText :exontrol.DrawTextFormatEnum

The formatText field specifies the flags the labels use to display on the legend. The exontrol.DrawTextFormatEnum type supports the following flags:
  • exTextAlignTop (0x00), justifies the text to the top of the rectangle
  • exTextAlignLeft (0x00), aligns text to the left
  • exTextAlignCenter (0x01), centers text horizontally in the rectangle
  • exTextAlignRight (0x02), aligns text to the right
  • exTextAlignVCenter (0x04), centers text vertically
  • exTextAlignBottom (0x08), justifies the text to the bottom of the rectangle.
  • exTextAlignMask (0x0F), specifies the mask for text's alignment.
  • exTextWordBreak (0x10), breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the lpRect parameter. A carriage return-line feed sequence also breaks the line. If this is not specified, output is on one line.
  • exTextSingleLine (0x20), displays text on a single line only. Carriage returns and line feeds do not break the line.
  • exTextExpandTabs (0x40), expands tab characters. The default number of characters per tab is eight.
  • exPlainText (0x80), treats the text as plain text.
  • exTextNoClip (0x0100), draws without clipping.
  • exHTMLTextNoColors (0x0200), ignores the and tags.
  • exTextCalcRect (0x0400), determines the width and height of the text.
  • exHTMLTextNoTags (0x0800), ignores all HTML tags.
  • exTextPathEllipsis (0x4000), for displayed text, replaces characters in the middle of the string with ellipses so that the result fits in the specified rectangle. If the string contains backslash (\) characters, exTextPathEllipsis preserves as much as possible of the text after the last backslash.
  • exTextEndEllipsis (0x8000), for displayed text, if the end of a string does not fit in the rectangle, it is truncated and ellipses are added. If a word that is not at the end of the string goes beyond the limits of the rectangle, it is truncated without ellipses.
  • exTextWordEllipsis (0x040000), truncates any word that does not fit in the rectangle and adds ellipses.
.
Type:
  • exontrol.DrawTextFormatEnum
Example
null {null}, by default, the label can display on multiple lines
 "center,vcenter,single" {string} or exontrol.DrawTextFormatEnum.exTextAlignCenter | exontrol.DrawTextFormatEnum.exTextAlignVCenter | exontrol.DrawTextFormatEnum.exTextSingleLine {exontrol.DrawTextFormatEnum} or 0x105 {number}, centers the label on a single line
formatText

(static) grid :any

The grid field indicates the number of columns or rows that the legend divides its content into. The grid field can be any of the following:
  • {number}, defines a number that specifies the number of columns to divide the legend
  • {string}, defines a string of "columns x rows" type that defines the number of columns and / or rows to arrange the legend objects. The columns and rows can be omitted.
  • {array}, indicates a two-elements array of [columns,rows] type that specifies the columns and / or rows to arrange the legend objects
.
Type:
  • any
Example
null {null}, by default, the number of columns, rows is not defined, so the legend objects are arranged for best fit
 "x2" {string} or [0,2] {array}, defines a maxium 2-rows arrangement
 "3 x 2" {string} or [3,2] {array}, defines a maxium 3-columns or 2-rows arrangement
grid

(static) labelFixedHeight :number

The labelFixedHeight field indicates the fixed-height to display the labels.
Type:
  • number
Example
null {null} or 0 {number}, by default, the labelFixedHeight has no effect
 64 {number}, fixes the label on a 64-pixel tall rectangle
labelFixedHeight

(static) labelFixedWidth :number

The labelFixedWidth field indicates the fixed-width to display the labels.
Type:
  • number
Example
null {null} or 0 {number}, by default, the labelFixedWidth has no effect
 64 {number}, fixes the label on a 64-pixel wide rectangle
labelFixedWidth

(static) locked :boolean

The locked field indicates whether the legend is locked(protected) or unlocked.
Type:
  • boolean
Example
false {boolean}, unlocks the legend (can show or hide the serie)
  true {boolean}, locks the legend (can't show or hide the serie)
locked

(static) pad :number|string|array

The pad field defines the legend's padding (space between legend's symbol and label). A value that could be a numeric value, to pad horizontal and vertical size with the same value, or a "x,y" or [x,y] type to specify the padding on h/v size.
Type:
  • number | string | array
Example
null {null}, indicates that the default-padding field is used ([4,4])
 0 {number}, indicates no padding
 2 {number}, indicates a 2-pixels horizontal padding and 2-pixels vertical padding
 "8,4" {string}, indicates 8-pixels horizontal padding and 4-pixels vertical padding
 [8,4] {array}, indicates 8-pixels horizontal padding and 4-pixels vertical padding
pad

(static) reverse :boolean

The reverse field reverses the order of the items within the legend.
Type:
  • boolean
Example
null {null}, by default, the items are ordered by their original-position (as they were added, unless the Position property of the Serie object has not been used)
 true {boolean}, reverses the order of the items within the legend
reverse

(static) symbolAlign :Graph.LegendSymbolAlignmentEnum

The symbolAlign field specifies the alignment of the symbol of the serie relative to the label of the serie. The exTop, exBottom, exLeft and exRight flags can be combined with exStart, exCenter or exEnd flags.
Type:
Example
null {null}, by default, the symbol is placed to the left and vertically centered relative to the label
 "right" {string} or exontrol.Graph.LegendSymbolAlignmentEnum.exRight {LegendSymbolAlignmentEnum} or 4 {number}, right-aligns the symbol relative with the label
symbolAlign

(static) symbolHeight :number

The symbolHeight field indicates the height to display the symbol.
Type:
  • number
Example
null {null}, by default, the symbolHeight is equivalent with the font's height
 0 {number}, no symbol is shown
 4 {number}, the symbol's height is fixed to 4-pixels tall
symbolHeight

(static) symbolWidth :number

The symbolWidth field indicates the width to display the symbol.
Type:
  • number
Example
null {null}, by default, the symbolWidth is equivalent with the font's height
 0 {number}, no symbol is shown
 8 {number}, the symbol's width is fixed to 8-pixels wide
symbolWidth

(static) visible :boolean

The visible field shows or hides the legend.
Type:
  • boolean
Example
null {null}, by default, the legend is hidden
 true {boolean}, shows the legend
visible