API: Bullet

Reusable Bullet Chart API class that renders a simple and configurable Bullet Chart.

(require("Bullet"))(_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 BulletChartData The data to attach and generate the chart
Source:

Requires

  • module:d3-array,

Methods


module:Bullet(_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 BulletChartData The data to attach and generate the chart
Source:

<static> aspectRatio(_x)

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

<static> colorSchema(_x)

Gets or Sets the colorSchema of the chart. The first color from the array will be applied to range bars (the wider bars). The second color from the array will be applied to measure bars (the narrow bars) and marker lines.
Parameters:
Name Type Description
_x Array.<String> Desired colorSchema for the graph
Source:
Returns:
Current colorSchema or Chart module to chain calls
Type
Array.<String> | module

<static> customSubtitle(_x)

Gets or Sets the subtitle for measure identifier range.
Parameters:
Name Type Description
_x String Desired customSubtitle for chart
Source:
Returns:
current customSubtitle or Chart module to chain calls
Type
String | module
Example
bulletChart.customSubtitle('GHz')

<static> customTitle(_x)

Gets or Sets the title for measure identifier range.
Parameters:
Name Type Description
_x String Desired customTitle for chart
Source:
Returns:
Current customTitle or Chart module to chain calls
Type
String | module
Example
bulletChart.customTitle('CPU Usage')

<static> exportChart(filename, title)

Chart exported to png and a download action is fired
Parameters:
Name Type Description
filename String File title for the resulting picture
title String Title to add at the top of the exported picture
Source:

<static> height(_x)

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

<static> isReverse(_x)

Gets or Sets the isReverse status of the chart. If true, the elements will be rendered in reverse order.
Parameters:
Name Type Default Description
_x Boolean false Desired height for the chart
Source:
Returns:
Current height or Chart module to chain calls
Type
Boolean | 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> numberFormat(_x)

Gets or Sets the number format of the bar chart
Parameters:
Name Type Description
_x string Desired number format for the bar chart
Source:
Returns:
Current numberFormat or Chart module to chain calls
Type
numberFormat | module

<static> paddingBetweenAxisAndChart(_x)

Space between axis and chart
Parameters:
Name Type Default Description
_x Number 5 Space between y axis and chart
Source:
Returns:
Current value of paddingBetweenAxisAndChart or Chart module to chain calls
Type
Number | module

<static> startMaxRangeOpacity(_x)

Gets or Sets the starting point of the capacity range.
Parameters:
Name Type Default Description
_x Number 0.5 Desired startMaxRangeOpacity for chart
Source:
Returns:
current startMaxRangeOpacity or Chart module to chain calls
Type
Number | module
Example
bulletChart.startMaxRangeOpacity(0.8)

<static> ticks(_x)

Gets or Sets the number of ticks of the x axis on the chart (Default is 5)
Parameters:
Name Type Description
_x Number Desired horizontal ticks
Source:
Returns:
Current ticks or Chart module to chain calls
Type
Number | module

<static> width(_x)

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