API: Legend

Legend Component reusable API class that renders a simple and configurable legend element.

(require("Legend"))(_selection, _data)

This function creates the graph using the selection as container
Parameters:
Name Type Description
_selection D3Selection A d3 selection that represents the container(s) where the chart(s) will be rendered
_data object The data to attach and generate the chart
Source:

Requires

  • module:d3

Methods


module:Legend(_selection, _data)

This function creates the graph using the selection as container
Parameters:
Name Type Description
_selection D3Selection A d3 selection that represents the container(s) where the chart(s) will be rendered
_data object The data to attach and generate the chart
Source:

<static> clearHighlight()

Clears the highlighted line entry
Source:

<static> colorSchema(_x)

Gets or Sets the colorSchema of the chart
Parameters:
Name Type Description
_x array Color scheme array to get/set
Source:
Returns:
Current colorSchema or Donut Chart module to chain calls
Type
number | module

<static> height(_x)

Gets or Sets the height of the legend chart
Parameters:
Name Type Description
_x number Desired width for the chart
Source:
Returns:
Current height or Legend module to chain calls
Type
height | module

<static> highlight(entryId)

Highlights a line entry by fading the rest of lines
Parameters:
Name Type Description
entryId number ID of the entry line
Source:

<static> horizontal(_x)

Gets or Sets the horizontal mode on the legend
Parameters:
Name Type Description
_x boolean Desired horizontal mode for the graph
Source:
Returns:
Current horizontal mode or Legend module to chain calls
Type
horizontal | module

<static> margin(_x)

Gets or Sets the margin of the legend chart
Parameters:
Name Type Description
_x object Margin object to get/set
Source:
Returns:
Current margin or Legend module to chain calls
Type
margin | module

<static> markerSize(_x)

Gets or Sets the markerSize of the legend chart. This markerSize will determine the horizontal and vertical size of the colored marks added as color identifiers for the chart's categories.
Parameters:
Name Type Description
_x object Margin object to get/set
Source:
Returns:
Current markerSize or Legend module to chain calls
Type
markerSize | module

<static> width(_x)

Gets or Sets the width of the legend chart
Parameters:
Name Type Description
_x number Desired width for the graph
Source:
Returns:
Current width or Legend module to chain calls
Type
width | module