htmlLegend is a attachable widget that can be added to other dc charts to render horizontal/vertical legend labels.
chart.legend(dc.htmlLegend().container(legendContainerElement).horizontal(false))
Set the container selector for the legend widget. Required.
Parameters: Name Type Argument Descriptioncontainer
String <optional>
This can be optionally used to enable highlighting legends for the selections/filters for the chart.
Parameters: Name Type Argument DescriptionhighlightSelected
String <optional>
Display the legend horizontally instead of vertically
Parameters: Name Type Argument Descriptionhorizontal
String <optional>
This can be optionally used to override class for legenditem and just use this class style. This is helpful for overriding the style of a particular chart rather than overriding the style for all charts.
Setting this will disable the highlighting of selected items also.
Parameters: Name Type Argument DescriptionlegendItemClass
String <optional>
Set or get the legend text function. The legend widget uses this function to render the legend text for each item. If no function is specified the legend widget will display the names associated with each group.
Parameters: Name Type Argument DescriptionlegendText
function <optional>
// default legendText legend.legendText(dc.pluck('name')) // create numbered legend items chart.legend(dc.htmlLegend().legendText(function(d, i) { return i + '. ' + d.name; })) // create legend displaying group counts chart.legend(dc.htmlLegend().legendText(function(d) { return d.name + ': ' d.data; }))
Maximum number of legend items to display
Parameters: Name Type Argument DescriptionmaxItems
Number <optional>
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