Zoom Plugin for Chartist.js
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
src/scripts
tasks
test
.editorconfig
.gitattributes
.gitignore
.jshintrc
.travis.yml
Gruntfile.js
LICENSE
README.md
bower.json
demo.html
package.json

README.md

Zoom plugin for Chartist.js

Please visit http://gionkunz.github.io/chartist-js/plugins.html for more information.

Currently only axes of type AutoScaleAxis are supported!

Available options and their defaults

var defaultOptions = {
  onZoom: undefined   // A callback (chart, resetFnc) => void which will be called on zoom. 
                      // resetFnc() will reset zoom.
  pointClipOffset: 5  // Offset from chart rect that will be used for the point clip mask.
                      // Should be equal to the radius of .ct-point points.
};

Sample usage in Chartist.js

var chart = new Chartist.Line('.ct-chart', {
  series: [/* */]
}, {
  axisX : {
    type: Chartist.AutoScaleAxis,
  },
  plugins: [
    Chartist.plugins.zoom({
      onZoom : function(chart, reset) { storeReset(reset); };
    })
  ]
});
/* style the svg rect */
.ct-zoom-rect {
  fill: rgba(200, 100, 100, 0.3);
  stroke: red;
}