d2bChart Axis

# d2b.chartAxis()

Constructs a new axis chart generator with the default settings.

When using the d2b-axis generator you can draw an axis chart onto each element in the selection.

# axis.advanced(context)

Render the axis chart(s) to the given context, which may be either a d3-selection of html containers (e.g. div) or a corresponding d3-transition.

Note: The advanced mode is new in d2b > 1.0.0. In advanced mode all of axis chart configuration properties will be available with the input datum.

# Properties

This is a complete list of properties may be supplied to the axis chart datum. Bold properties are required.

PropertyDetails
data.sets
Axis chart graph set data.

Type: array
Required: true
data.duration
The internal chart duration in miliseconds.

Type: number
Default: 250
Optional: true
data.graphColor
Chart axis graph color or accessor function.

Type: string, (data) => string
Default: d => colorGenerator(d.label)
Optional: true
data.groupColor
Chart axis group color or accessor function.

Type: string, (data) => string
Default: d => colorGenerator(d.label)
Optional: true
data.updated
Event hook for d2b charts. Will be after the chart is rendered. Note: Transitions may still occur after this lifecycle hook fires.

Type: (this, data) => void
Optional: true
data.annotations
Chart annotations. Refer to the d3-annotation [docs](https://d3-annotation.susielu.com) for additional annotation configuration.

Type: array
Optional: true
data.chartPadding
The chart's inner padding (excluding the legend) in pixels.

Type: number, object
Default: 10
Optional: true
data.groups
Axis chart groups. Groups are used to group multiple graph's together on the legend.

Type: array
Optional: true
data.legend
Chart legend configuration options.

Type: object
Optional: true
data.padding
The chart's outer padding (including the legend) in pixels.

Type: number, object
Default: 10
Optional: true
data.planeMargin
The chart's plane margin. This is useful if additional space is required for axis labels or ticks.

Type: number, object
Default: 10
Optional: true
data.planePadding
The chart's plane padding. If set to null the padding will be computed automatically based on the axis label and tick sizes.

Type: null, number, object
Default: null
Optional: true
data.size
The pixel size of the chart.

Type: object
Optional: true
data.tooltip
Chart tooltip configuration options.

Type: object
Optional: true
data.x
X-axis (bottom) config

Type: object
Optional: true
data.x2
X2-axis (top) config

Type: object
Optional: true
data.y
Y-axis (left) config

Type: object
Optional: true
data.y2
Y2-axis (right) config

Type: object
Optional: true

results matching ""

    No results matching ""