API Docs for: 0.0.2
Show:

chart.Labels Class

Module: Canvas

Class displaying labels for a chart. See Chart/Pie for example on how to add labels to your chart. How labels are displayed(side by side or beneath each other) depends on the orientation attribute OR the size of the area assigned to the labels. You can set orientation to "vertical" or "horizontal". If orientation is not set and width is greater than height, the labels will be displayed vertically. If height is greater than width, the labels will be rendered vertically.

Attributes

boxStyles

Object

Styling of color box displayed left of text label. The box will always be displayed in the same color as the chart item it's representing.

Default: undefined

Example:

boxStyles:{ 'stroke' : '#000' }

boxStylesOver

Object

Styling of color box when highlighted. By default fill will be set to a slightly brighter color than the chart item it's representing.

Default: undefined

Example:

boxStylesOver:{ 'stroke-width' : 1, 'stroke' : '#000' }

orientation

String

Orientation of labels. If not set, orientation will be set automatically base on space allocated to the labels. When width is greater than height, the labels will be displayed horizontally, side by side. Otherwise, they will be displayed vertically.

Default: undefined

textStyles

Object

Styling options for text

Default: { fill:'#000000', 'font-size' : '13px', 'font-weight' : 'normal' }

Example:

textStyles:{ 'font-size' : '14px', 'font-weight' : 'normal' }

textStylesOver

Object

Styling options for text of labels for highlighted chart items.

Default: { 'font-weight': 'bold' }

Example:

textStylesOver:{ 'fill' : '#000', 'font-weight' : 'bold' }