A display of a single numeric value.
Unlike other charts, you do not need to set a dimension. Instead a group object must be provided and a valueAccessor that returns a single value.
If the group is a groupAll then its .value()
will be displayed. This is the recommended usage.
However, if it is given an ordinary group, the numberDisplay
will show the last bin's value, after sorting with the ordering function. numberDisplay
defaults the ordering
function to sorting by value, so this will display the largest value if the values are numeric.
parent
String | node | d3.selection
Any valid d3 single selector specifying a dom block element such as a div; or a dom element or d3 selection.
chartGroup
String <optional>
The name of the chart group this chart instance should be placed in. Interaction with a chart will only trigger events and redraws within the chart's group.
// create a number display under #chart-container1 element using the default global chart group var display1 = dc.numberDisplay('#chart-container1');
Get or set a function to format the value for the display.
Parameters: Name Type Argument Default Descriptionformatter
function <optional>
Gets or sets an optional object specifying HTML templates to use depending on the number displayed. The text %number
will be replaced with the current value.
html
Object <optional>
numberWidget.html({ one:'%number record', some:'%number records', none:'no records'})
Calculate and return the underlying value of the display.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4