Skip to main content

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);

exports(_selection, _data) ⏏

Deprecated

This function creates the graph using the selection as container

Kind: Exported function

ParamTypeDescription
_selectionD3SelectionA d3 selection that represents the container(s) where the chart(s) will be rendered
_dataStepChartDataThe 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

ParamTypeDescription
filenameStringFile title for the resulting picture
titleStringTitle 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

ParamTypeDescription
_xobjectMargin 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

ParamTypeDescription
_xNumberDesired 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

ParamTypeDescription
_xnumberDesired 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

ParamTypeDescription
flagbooleanDesired 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

ParamTypeDescription
_xnumberDesired 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

ParamTypeDescription
_xStringDesired 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

ParamTypeDescription
_xNumberDesired 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

ParamTypeDescription
_xStringDesired 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

ParamTypeDescription
_xNumberDesired offset for the label

exports~StepChartData : Array.<Object>

Kind: inner typedef of exports
Properties

NameTypeDescription
keyStringKey we measure (required)
valueNumbervalue of the key (required)

Example

[
{
value: 1,
key: 'glittering'
},
{
value: 1,
key: 'luminous'
}
]