Line Chart reusable API module that allows us
rendering a multi line and configurable chart.
(require("Line"))(_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 |
LineChartData | 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:Line(_selection, _data)
-
This function creates the graph using the selection and data provided
Parameters:
Name Type Description _selectionD3Selection A d3 selection that represents the container(s) where the chart(s) will be rendered _dataLineChartData 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 _xNumber Desired aspect ratio for the graph - Source:
Returns:
Current aspect ratio or Line Chart module to chain calls- Type
- Number | Module
-
<static> colorSchema(_x)
-
Gets or Sets the colorSchema of the chart
Parameters:
Name Type Description _xArray.<String> Desired colorSchema for the graph - Source:
Returns:
Current colorSchema or Chart module to chain calls- Type
- colorSchema | module
-
<static> dateLabel(_x)
-
Gets or Sets the dateLabel of the chart
Parameters:
Name Type Description _xNumber Desired dateLabel for the graph - Source:
Returns:
Current dateLabel or Chart module to chain calls- Type
- dateLabel | module
-
<static> exportChart()
-
Chart exported to png and a download action is fired
- Source:
-
<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> 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 Line Chart module to chain calls- Type
- Number | 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 Line Chart module to chain calls- Type
- Number | Module
-
<static> on()
-
Exposes an 'on' method that acts as a bridge with the event dispatcher We are going to expose this events: customMouseHover, customMouseMove and customMouseOut
- Source:
Returns:
Bar Chart- Type
- module
-
<static> tooltipThreshold(_x)
-
Gets or Sets the minimum width of the graph in order to show the tooltip NOTE: This could also depend on the aspect ratio
Parameters:
Name Type Description _xNumber Desired tooltip threshold for the graph - Source:
Returns:
Current tooltip threshold or Line Chart module to chain calls- Type
- Number | Module
-
<static> topicLabel(_x)
-
Gets or Sets the topicLabel of the chart
Parameters:
Name Type Description _xNumber Desired topicLabel for the graph - Source:
Returns:
Current topicLabel or Chart module to chain calls- Type
- topicLabel | module
-
<static> valueLabel(_x)
-
Gets or Sets the valueLabel of the chart
Parameters:
Name Type Description _xNumber 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 _xNumber Desired width for the graph - Source:
Returns:
Current width or Line Chart module to chain calls- Type
- Number | Module