Module implementing a semi-circular gauge widget.
Requires: d3@v4 du.Widget
du.widgets.semicirculargauge.SemiCircularGauge(name[, parent])
The semi-circular gauge widget class.
arg type description name stringIdentifier of the widget. parent objectParent element to append widget to. If not specified, widget is appended to body. optional
du.widgets.semicirculargauge.SemiCircularGauge.min(value)
Sets the lower boundary of the gauge.
arg type description value numberLower boundary.
return description du.widgets.semicirculargauge.SemiCircularGaugeReference to the current SemiCircularGauge.
du.widgets.semicirculargauge.SemiCircularGauge.max(value)
Sets the upper boundary of the gauge.
arg type description value numberUpper boundary.
return description du.widgets.semicirculargauge.SemiCircularGaugeReference to the current SemiCircularGauge.
du.widgets.semicirculargauge.SemiCircularGauge.segments(num)
Sets the number of segments of the gauge bar. Default value is 4.
arg type description num numberNumber of segments.
return description du.widgets.semicirculargauge.SemiCircularGaugeReference to the current SemiCircularGauge.
du.widgets.semicirculargauge.SemiCircularGauge.gap(num)
Sets the angle of the gap between segments. Default value is 6 degrees.
arg type description num numberGap angle between segments in degrees.
return description du.widgets.semicirculargauge.SemiCircularGaugeReference to the current SemiCircularGauge.
du.widgets.semicirculargauge.SemiCircularGauge.thickness(size)
Sets the thickness of the segments in units of the radius. Default is 0.2.
arg type description size numberSize of the thickness relative to the gauge radius.
return description du.widgets.semicirculargauge.SemiCircularGaugeReference to the current SemiCircularGauge.
du.widgets.semicirculargauge.SemiCircularGauge.colors(colors)
Sets the min and max color of the gauge. Must be an array with two colors. The color of intermediate segments is interpolated with HSL interpolation. Default values are the first red and green colors from Color Brewer (['#e41a1c', '#4daf4a']).
Overrides:
du.widgets.Widget.colorsarg type description colors string[]Start and end colors of the gauge.
return description du.widgets.semicirculargauge.SemiCircularGaugeReference to the current SemiCircularGauge.
du.widgets.semicirculargauge.SemiCircularGauge.position(value)
Sets the position of the needle to the specified value.
arg type description value numberThe value to set the needle's position to. If value is set to null, the needle is hidden.
return description du.widgets.semicirculargauge.SemiCircularGaugeReference to the current SemiCircularGauge.