step
Step
Deprecated
Step Chart reusable API class that renders a simple and configurable step chart. NOTE: We will be deprecating this chart soon
Requires: module:d3-array,
Example
const stepChart= step();
stepChart
.height(500)
.width(800);
d3Selection.select('.css-selector')
.datum(dataset)
.call(stepChart);
Stepexports(_selection, _data) ⏏- static
- .exportChart(filename, title) ⇒
Promise - .margin(_x) ⇒
margin|module - .yTicks(_x) ⇒
Number|module - .height(_x) ⇒
height|module - .isLoading(flag) ⇒
boolean|module - .on() ⇒
module - .width(_x) ⇒
width|module - .xAxisLabel(_x) ⇒
String|module - .xAxisLabelOffset(_x) ⇒
Number|module - .yAxisLabel(_x) ⇒
String|module - .yAxisLabelOffset(_x) ⇒
Number|module
- .exportChart(filename, title) ⇒
- inner
- ~StepChartData :
Array.<Object>
- ~StepChartData :
- static
exports(_selection, _data) ⏏
Deprecated
This function creates the graph using the selection as container
Kind: Exported function
| Param | Type | Description |
|---|---|---|
| _selection | D3Selection | A d3 selection that represents the container(s) where the chart(s) will be rendered |
| _data | StepChartData | The data to attach and generate the chart |
exports.exportChart(filename, title) ⇒ Promise
Chart exported to png and a download action is fired
Kind: static method of exports
Returns: Promise - Promise that resolves if the chart image was loaded and downloaded successfully
Access: public
| Param | Type | Description |
|---|---|---|
| filename | String | File title for the resulting picture |
| title | String | Title to add at the top of the exported picture |
exports.margin(_x) ⇒ margin | module
Gets or Sets the margin of the chart
Kind: static method of exports
Returns: margin | module - Current margin or Chart module to chain calls
Access: public
| Param | Type | Description |
|---|---|---|
| _x | object | Margin object to get/set |
exports.yTicks(_x) ⇒ Number | module
Gets or Sets the number of vertical ticks on the chart (Default is 6)
Kind: static method of exports
Returns: Number | module - Current yTicks or Chart module to chain calls
Access: public
| Param | Type | Description |
|---|---|---|
| _x | Number | Desired number of vertical ticks for the graph |
exports.height(_x) ⇒ height | module
Gets or Sets the height of the chart
Kind: static method of exports
Returns: height | module - Current height or Chart module to chain calls
Access: public
| Param | Type | Description |
|---|---|---|
| _x | number | Desired width for the graph |
exports.isLoading(flag) ⇒ boolean | module
Gets or Sets the loading state of the chart
Kind: static method of exports
Returns: boolean | module - Current loading state flag or Chart module to chain calls
Access: public
| Param | Type | Description |
|---|---|---|
| flag | boolean | Desired value for the loading state |
exports.on() ⇒ module
Exposes an 'on' method that acts as a bridge with the event dispatcher We are going to expose this events: customMouseOver, customMouseMove and customMouseOut
Kind: static method of exports
Returns: module - Bar Chart
Access: public
exports.width(_x) ⇒ width | module
Gets or Sets the width of the chart
Kind: static method of exports
Returns: width | module - Current width or Chart module to chain calls
Access: public
| Param | Type | Description |
|---|---|---|
| _x | number | Desired width for the graph |
exports.xAxisLabel(_x) ⇒ String | module
Gets or Sets the text of the xAxisLabel on the chart
Kind: static method of exports
Returns: String | module - label or Chart module to chain calls
Access: public
| Param | Type | Description |
|---|---|---|
| _x | String | Desired text for the label |
exports.xAxisLabelOffset(_x) ⇒ Number | module
Gets or Sets the offset of the xAxisLabel on the chart
Kind: static method of exports
Returns: Number | module - label or Chart module to chain calls
Access: public
| Param | Type | Description |
|---|---|---|
| _x | Number | Desired offset for the label |
exports.yAxisLabel(_x) ⇒ String | module
Gets or Sets the text of the yAxisLabel on the chart
Kind: static method of exports
Returns: String | module - label or Chart module to chain calls
Access: public
| Param | Type | Description |
|---|---|---|
| _x | String | Desired text for the label |
exports.yAxisLabelOffset(_x) ⇒ Number | module
Gets or Sets the offset of the yAxisLabel on the chart
Kind: static method of exports
Returns: Number | module - label or Chart module to chain calls
Access: public
| Param | Type | Description |
|---|---|---|
| _x | Number | Desired offset for the label |
exports~StepChartData : Array.<Object>
Kind: inner typedef of exports
Properties
| Name | Type | Description |
|---|---|---|
| key | String | Key we measure (required) |
| value | Number | value of the key (required) |
Example
[
{
value: 1,
key: 'glittering'
},
{
value: 1,
key: 'luminous'
}
]