Class: c3.Plot.Zoomable

Defined in: js/c3-plot.coffee
Inherits: c3.Plot

Overview

TODO: Normalize zoom functionality better (horiz and vert) (for both plot and axis, maybe chart)
TODO: Support zooming with layers or axes that don't share the chart's horizontal scale

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:

Events

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.

Author:

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

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

Parameters:

  • extent ( Array<Number> ) The domain to set the focus to.

# (void) pan(dy) Bound

Note: dx (horizontal panning) is controlled by the zoomer

# (void) _draw(origin) Bound

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: