API: Sparkline

Sparkline Chart reusable API module that allows us rendering a sparkline configurable chart.

(require("Sparkline"))(_selection, _data)

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

Requires

  • module:d3

Methods


module:Sparkline(_selection, _data)

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

<static> areaGradient(_x)

Gets or Sets the areaGradient of the chart
Parameters:
Name Type Description
_x Array.<String> Desired areaGradient for the graph
Source:
Returns:
Current areaGradient or Chart module to chain calls
Type
areaGradient | module

<static> dateLabel(_x)

Gets or Sets the dateLabel of the chart
Parameters:
Name Type Description
_x Number Desired dateLabel for the graph
Source:
Returns:
Current dateLabel or Chart module to chain calls
Type
dateLabel | module

<static> duration(_x)

Gets or Sets the duration of the animation
Parameters:
Name Type Description
_x Number Desired animation duration for the graph
Source:
Returns:
Current animation duration or Chart module to chain calls
Type
dateLabel | module

<static> exportChart()

Chart exported to png and a download action is fired
Source:

<static> height(_x)

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

<static> isAnimated(_x)

Gets or Sets the isAnimated property of the chart, making it to animate when render. By default this is 'false'
Parameters:
Name Type Description
_x Boolean Desired animation flag
Source:
Returns:
Current isAnimated flag or Chart module
Type
isAnimated | module

<static> lineGradient(_x)

Gets or Sets the lineGradient of the chart
Parameters:
Name Type Description
_x Array.<String> Desired lineGradient for the graph
Source:
Returns:
Current lineGradient or Chart module to chain calls
Type
lineGradient | module

<static> margin(_x)

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

<static> valueLabel(_x)

Gets or Sets the valueLabel of the chart
Parameters:
Name Type Description
_x Number Desired valueLabel for the graph
Source:
Returns:
Current valueLabel or Chart module to chain calls
Type
valueLabel | module

<static> width(_x)

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