Brush Chart reusable API class that renders a
simple and configurable brush chart.
(require("Brush"))(_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 |
BrushChartData | The data to attach and generate the chart |
- Source:
Requires
- module:d3-array,
Members
-
<static> axisTimeCombinations
-
constants to be used to force the x axis to respect a certain granularity current options: HOUR_DAY, DAY_MONTH, MONTH_YEAR
- Source:
Example
line.forceAxisFormat(line.axisTimeCombinations.HOUR_DAY)
Methods
-
module:Brush(_selection, _data)
-
This function creates the graph using the selection as container
Parameters:
Name Type Description _selectionD3Selection A d3 selection that represents the container(s) where the chart(s) will be rendered _dataBrushChartData The data to attach and generate the chart - Source:
-
<static> dateRange(_x)
-
Gets or Sets the dateRange for the selected part of the brush
Parameters:
Name Type Description _xArray.<String> Desired dateRange for the graph - Source:
Returns:
Current dateRange or Chart module to chain calls- Type
- dateRange | module
-
<static> forceAxisFormat(_x)
-
Exposes the ability to force the chart to show a certain x axis grouping
Parameters:
Name Type Description _xString Desired format - Source:
Returns:
Current format or module to chain calls- Type
- String | Module
-
<static> gradient(_x)
-
Gets or Sets the gradient of the chart
Parameters:
Name Type Description _xArray.<String> Desired gradient for the graph - Source:
Returns:
Current gradient or Chart module to chain calls- Type
- gradient | module
-
<static> height(_x)
-
Gets or Sets the height of the chart
Parameters:
Name Type Description _xnumber Desired width for the graph - Source:
Returns:
Current height or Chart module to chain calls- Type
- height | module
-
<static> margin(_x)
-
Gets or Sets the margin of the chart
Parameters:
Name Type Description _xobject Margin object to get/set - Source:
Returns:
Current margin or Chart module to chain calls- Type
- margin | module
-
<static> onBrush(_x)
-
Gets or Sets the callback that will be called when the user brushes over the area
Parameters:
Name Type Description _xfunction Callback to call - Source:
Returns:
Current callback function or the Chart Module- Type
- function | module
-
<static> width(_x)
-
Gets or Sets the width of the chart
Parameters:
Name Type Description _xnumber Desired width for the graph - Source:
Returns:
Current width or Chart module to chain calls- Type
- width | module