Class: c3.Plot.Zoomable
Defined in: | js/c3-plot.coffee |
Inherits: | c3.Plot |
Overview
A type of plot that allows panning and zooming.
You cannot currently zoom with an ordinal scale.
External Interface
In addition to the standard {c3.base c3 interface}, this chart adds:
- focus() - Zoom the chart to the specified domain. Will not fire zoom events.
Events
- zoom - Triggered when the user starts to zoom or pan. Passed with the current focus domain.
- zoomend - Triggered when the user finishes zooming or panning. Passed with the focus domain.
Extensibility
The h scale will adjust it's domain based on the current focus of the chart. The original domain can be retreived using the _orig_h_ scale.
Variables Summary
- version =
-
0.0
- type =
-
'zoomable'
- snap_to_all =
-
0.01
[Number] A ratio threshold. If the focus domain is within this threshold near both edges, then the chart will snap to the full domain.
- zoom_extent =
-
undefined
[Number, String] The maximum zoom factor the user is allowed to zoom in If set to integer then allow zooming only until pixels are integer values.
- pannable =
-
'h'
[String] Enables vertical panning. Horizontal panning is controlled by the zoomer. Values are either 'h' or 'hv'. 'h' is the default. At the moment this only works reliably on the Flamechart
Variable inherited from c3.Plot
version type layers axes data h v x y h_orient v_orient h_domain v_domain margins crop_margins layer_options axis_options class options content_options _next_uid anchor height width anchor_styles handlers
Instance Method Summary
- # (void) _init() Bound
- # (void) _size() Bound
- # (void) focus(extent) Bound Zoom to a specified focus domain, but only if the domain actually changes
- # (void) pan(dy) Bound Note: dx (horizontal panning) is controlled by the zoomer
- # (void) _draw(origin) Bound
Inherited Method Summary
Methods inherited from
c3.Plot
#_init #_size #_update #_draw #_style #scale #rescale #min_x #max_x #min_y #max_y #init #style #render #resize #redraw #restyle #_prep #size #update #draw
Instance Method Details
#
(void)
_init()
Bound
#
(void)
_size()
Bound
#
(void)
focus(extent)
Bound
Zoom to a specified focus domain, but only if the domain actually changes
#
(void)
pan(dy)
Bound
Note: dx (horizontal panning) is controlled by the zoomer
#
(void)
_draw(origin)
Bound