Parent element to append widget to. If not specified, widget is appended to body. optional
xMin
du.widgets.linechart.LineChart.xMin(value)
Sets the lower boundary for the X axis.
arg
type
description
value
number
The value of the lower boundary.
return
description
du.widgets.linechart.LineChart
Reference to the current LineChart.
xMax
du.widgets.linechart.LineChart.xMax(value)
Sets the upper boundary for the X axis.
arg
type
description
value
number
The value of the upper boundary.
return
description
du.widgets.linechart.LineChart
Reference to the current LineChart.
xType
du.widgets.linechart.LineChart.xType(type)
Sets the type of the X axis. Supported values are: number, time, string. Default is number.
arg
type
description
type
string
Type of the X axis.
return
description
du.widgets.linechart.LineChart
Reference to the current LineChart.
lineStyles
du.widgets.linechart.LineChart.lineStyles(style)
Sets line styles for each plot.
arg
type
description
style
Object
Object containing the style for each plot. A style is an object with SVG styles to set. Currently only stroke-dasharray is supported.
return
description
du.widgets.linechart.LineChart
Reference to the current LineChart.
smooth
du.widgets.linechart.LineChart.smooth(on)
Adds smoothing to the curves and error bands. Smoothing is done by using Catmull-Rom splines for each curve. Default is false.
arg
type
description
on
boolean
Whether to add smoothing to the curves.
return
description
du.widgets.linechart.LineChart
Reference to the current LineChart.
dots
du.widgets.linechart.LineChart.dots(on)
Adds dots to the lines at each data point. Default value is false.
arg
type
description
on
boolean
Whether to add dots to the lines.
return
description
du.widgets.linechart.LineChart
Reference to the current LineChart.
data
du.widgets.linechart.LineChart.data(data)
Binds data to the line plot. 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. All plots are sorted by their x values before plot.
Adds a marker to the specified line. A marker is a text along with a 90-degree angle connecting two points of a line. If a marker with the specified identifier already exists, the marker is ignored.
arg
type
description
id
string
Marker identifier.
key
string
Key of the line to mark.
start
numberstring
Start X position of the marker.
end
numberstring
End X position of the marker.
label
string
Label of the marker.
return
description
object
D3 selection of the marker if it could be added, null otherwise.
removeMarker
du.widgets.linechart.LineChart.removeMarker(id)
Removes a marker from the plot.
arg
type
description
id
string
Identifier of the marker to remove.
return
description
boolean
True if marker exists and could be removed, false otherwise.
Adds a pin to the specified line. A pin is a vertical line with a circle on top denoting a specific location in the chart. If a pin with the specified identifier already exists, the pin is ignored.
arg
type
description
id
string
Pin identifier.
pos
numberstring
Pin position on the X axis.
color
string
Pin color. Defaults to font color.
size
string
Pin head radius. Default is 4 pixels.
height
string
Height of the pin relative to the vertical range. Defaults to 1.
return
description
object
D3 selection of the pin if it could be added, null otherwise.
removePin
du.widgets.linechart.LineChart.removePin(id)
Removes a pin from the plot.
arg
type
description
id
string
Identifier of the pin to remove.
return
description
boolean
True if pin exists and could be removed, false otherwise.