Class: c3.Legend.PlotLegend
Defined in: | js/c3-legend.coffee |
Inherits: | c3.Legend |
Overview
A type of C3 Legend that is linked with a C3 Chart Plot.
It will display each layer in the plot as a legend items.
For stacked layers, each stack will be a nested item.
The names in the legend will be based on the name
attribute of the layers and stacks.
If the name
is false
, then the layer will not be displayed.
The legend is linked with the plot, so hovering over the legend items will highlight the cooresponding data in the plot. The functionality leverages the base legend and can be further customized or adjusted by the user.
Variables Summary
- version =
-
0.1
- type =
-
'plot_legend'
- plot =
-
undefined
[c3.Plot] Plot to link with this legend
- invert_layers =
-
false
[Boolean] Invert the order of the layers in the legend.
false
- Layers on top are at the top of the legend.true
- Layers on top are at the bottom of the legend.
- html_names =
-
false
[Boolean] By default, the layer and stack names will display as raw text. If you would like HTML tags in the name string to render as HTML, then enable this option. Please be careful of user-provided strings and security.
- hover_fade =
-
0.2
[Number] When hovering over an item the other layers/stacks in the plot will fade to this percentage of their original opacity.
- duration =
-
750
[Number] The duration in milliseconds that animations should take, such as stacked elements floating down to the bottom of the chart.
Variable inherited from c3.Legend
version type data key filter nest nest_key hoverable list_options list_item_options item_options item_option nested_list_item_options nested_item_options bullet_options nested_bullet_options _next_uid anchor height width anchor_styles handlers
Instance Method Summary
- # (void) _init() Bound
- # (void) _update() Bound
- # (void) _style() Bound
Inherited Method Summary
Methods inherited from
c3.Legend
#_init #_update #_style #render #resize #redraw #restyle #init #_prep #size #_size #update #draw #_draw #style
Instance Method Details
#
(void)
_init()
Bound
#
(void)
_update()
Bound
#
(void)
_style()
Bound