Turn automatic width for legend items on or off. If true, itemWidth is ignored. This setting takes into account the gap.
Parameters: Name Type Argument Default DescriptionautoItemWidth
Boolean <optional>
Set or get gap between legend items.
Parameters: Name Type Argument Default Descriptiongap
Number <optional>
This can be optionally used to enable highlighting legends for the selections/filters for the chart.
Parameters: Name Type Argument DescriptionhighlightSelected
String <optional>
Position legend horizontally instead of vertically.
Parameters: Name Type Argument Default Descriptionhorizontal
Boolean <optional>
Set or get legend item height.
Parameters: Name Type Argument Default DescriptionitemHeight
Number <optional>
Legend item width for horizontal legend.
Parameters: Name Type Argument Default DescriptionitemWidth
Number <optional>
If set, individual legend items will be focusable from keyboard and on pressing Enter or Space will behave as if clicked on.
If svgDescription
on the parent chart has not been explicitly set, will also set the default SVG description text to the class constructor name, like BarChart or HeatMap, and make the entire SVG focusable.
keyboardAccessible
Boolean <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(pluck('name')) // create numbered legend items chart.legend(new Legend().legendText(function(d, i) { return i + '. ' + d.name; })) // create legend displaying group counts chart.legend(new Legend().legendText(function(d) { return d.name + ': ' d.data; }))
Maximum width for horizontal legend.
Parameters: Name Type Argument Default DescriptionlegendWidth
Number <optional>
Maximum number of legend items to display
Parameters: Name Type Argument DescriptionmaxItems
Number <optional>
Set or get x coordinate for legend widget.
Parameters: Name Type Argument Default Descriptionx
Number <optional>
Set or get y coordinate for legend widget.
Parameters: Name Type Argument Default Descriptiony
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