Sets X domain for the multi bar chart. The order of the values specified in the domain are used to sort the data in the chart. Default is off.
arg
type
description
domain
number[]string[]
Array containing the domain values.
return
description
du.widgets.multibarchart.MultiBarChart
Reference to the current BarChart.
data
du.widgets.multibarchart.MultiBarChart.data(data)
Binds data to the bar chart. Expected data format: array containing an object for each plot. A plot object has a name property with the name of the plot and a values property which is the array of (x, y) coordinates. Each data point can have two optional values lo, hi representing the error of the y value. Default values of lo and hi for all data points are 0. Note that the data is sorted by the X values assuming they are strings.
Adds a marker to the chart. A marker is a horizontal line with a label. If a marker with the specified identifier already exists, the marker is ignored.
arg
type
description
id
string
Marker identifier.
value
numberstring
Y value (height) of the marker line.
label
string
Label of the marker.
pos
string
Position of the label relative to the marker line. Default is 0.
color
string
Color of the marker. Default is the font color.
anchor
string
Text anchor. Supported values: start, middle, right. Default is start.
return
description
object
D3 selection of the marker if it could be added, null otherwise.