Zoom and pan plugin for Chart.js

Overview

chartjs-plugin-zoom

GitHub Workflow Status Coverage Status release npm (latest) npm (next) documentation Awesome

A zoom and pan plugin for Chart.js >= 3.0.0

For Chart.js 2.6.0 to 2.9.x support, use version 0.7.7 of this plugin.

Panning can be done via the mouse or with a finger. Zooming is done via the mouse wheel or via a pinch gesture. Hammer.js is used for gesture recognition.

Documentation

You can find documentation for chartjs-plugin-zoom at www.chartjs.org/chartjs-plugin-zoom.

Prior to v0.4.0, this plugin was known as 'Chart.Zoom.js'. Old versions are still available on npm under that name.

Contributing

Before submitting an issue or a pull request to the project, please take a moment to look over the contributing guidelines first.

License

chartjs-plugin-zoom.js is available under the MIT license.

Comments
  • No x-axis pan or zoom using Chart.js 2.6.0

    No x-axis pan or zoom using Chart.js 2.6.0

    chartjs-plugin-zoom seems to have some problems in conjunction with Chart.js 2.6.0: In my case, I cannot pan or zoom on the x-axis.

    When I simply run npm install [email protected] x-axis panning and zooming starts working again immediately. Running npm install [email protected] breaks x-axis pan&zoom again. So it looks like a problem with the chart.js version.

    Are you experiencing the same problems or is this working for you? Any ideas what I can do to upgrade to the latest version of chartjs-plugin-zoom (it has 2.6.0 as dependency)? Please help.

    In my config I use:

    pan: {
       enabled: true,
       mode: 'xy',
       rangeMin: {
         x: null,
         y: null
       },
       rangeMax: {
         x: null,
         y: null
       }
     },
     zoom: {
       enabled: true,
       mode: 'xy',
     }
    

    Enviroment:

    • Ionic 3.5.3
    • ng2-charts 1.6.0

    Edit: Chart-type: time

    opened by meisterlampe 36
  • Add an ESM build

    Add an ESM build

    Based off of chartjs-plugin-annotation's approach.

    Specific changes:

    • Switch from Gulp to Rollup for build; using Rollup directly works and seems simpler.
    • Refactor some duplicate configuration in rollup.config.js.
    • Change import style for Chart.js and Chart.js helpers so that it will work with modules.
    • The new import style doesn't allow adding to the imported object, which caused problems for the Chart.Zoom namespace. Since that namespace appears to be undocumented and unused, I removed it.

    The ESM version does not automatically register the plugin. This matches chartjs-plugin-annotation and seems to better match Chart.js 3's tree-shaking design.

    I'm unclear on whether the UMD build should automatically register the plugin. Not registering seems to better match Chart.js 3, and chartjs-plugin-datalabels recently changed to no longer register, but chartjs-plugin-annotation's UMD build does register.

    enhancement 
    opened by joshkel 21
  • dynamic load data on pan

    dynamic load data on pan

    Hello,

    it's possible to load data when panning the chart? i would like to have an "infinite" panning mode (or with a certain bound) start from min = YESTERDAY max = NOW

    and be able to pan till min = 2 YEARS AGO

    of course, the min-max interval should be respected.

    now, i pan, if i have an event to fecth another block of data to feed the chart, will be nice

    regards

    enhancement 
    opened by ramarro123 21
  • Zoom speed?

    Zoom speed?

    Hi, I have tried varying Zoom sensitivity value from 10 (very slow) to 0.0001 (pretty fast) but it seems that the dataset is Zoomed in 1 data point at a time.

    Is there any way to control the 'step' of zoom function?

    Thanks for any help.

    enhancement help wanted 
    opened by vzelenko 20
  • Pan & zoom not working for x-axis

    Pan & zoom not working for x-axis

    Hi, I am trying to get pan & zoom working but I am not able to do that on X-axis even though I have the following settings. The provided examples works fine and I am trying to mimic those.

    pan: { enabled: true, mode: 'xy' limits: { max: 10, min: 0.5 } },

    zoom: { enabled: true, mode: 'xy' limits: { max: 10, min: 0.5 } },

    What are the common mistakes when this happens? Fiddle: https://jsfiddle.net/jm1adysp/3/

    enhancement 
    opened by Intelli32 20
  • Use Rollup to build the library

    Use Rollup to build the library

    As a first iteration to integrate into this plugin the tools used in the core and other plugins, this PR adds Rollup as module bundler to build the library. It allows to use ES modules, so we'll be able to split the plugin into several files.

    • Rewrite the build task using Rollup and some Rollup plugins
    • Remove old libraries used for building
    • The dist files are now generated into /dist and unversioned
    • The old dist files have been removed
    • Rename the source file to plugin.js (as in chartjs-plugin-datalabels)

    Notes:

    • This PR contains a breaking change since the distribution files are moved to /dist, so it should imply a 0.7 version
    • I think the Travis config should be updated to generate the dist files automatically on release (in a separate PR?)
    opened by jledentu 15
  • Fix the calculation of the zoom center coordinate when dragging

    Fix the calculation of the zoom center coordinate when dragging

    Problem

    When the drag option is set to true and dragging to select a part of the chart area, the zoomed area is not correct. For example, select the x-axis from 0 to 100 in the following chart. https://jsfiddle.net/nagix/qb3ycp9v/

    Solution

    This PR fixes the calculation of the zoom center coordinate when dragging.

    • When selecting an area between the left edge and some point in the chart, the zoom center should be the left edge
    • When selecting an area between the right edge and some point in the chart, the zoom center should be the right edge
    • The x coordinate of the zoom center doesn't change before and after zooming
    screen shot 2018-08-22 at 11 45 22 pm

    Fixes #52 Fixes #154

    bug 
    opened by nagix 15
  • Drag zoom loosing data points

    Drag zoom loosing data points

    Hi

    I am working on an implementation of the zoom plugin using the drag feature. I am following the samples/zoom-time.html example. When i drag a zoom area, the resulting line chart looses data points. This happens in both my chart and the example chart.

    Drag:

    screen shot 2016-11-01 at 4 56 34 pm 2

    Result:

    screen shot 2016-11-01 at 4 56 40 pm

    As you can see the first data point is gone and the resulting chart is off too. The result in mine is even more extreme with more of a flattening line. It kind of looks like the chart data is averaged instead of zoomed.

    Here is the zoom config I am using:

    zoom: {
      enabled: true,
      drag: true,
      mode: 'x',
      limits: {
        max: 10,
        min: 0.5
      }
    }
    

    limits was in the example but I do not see in in chart.zoom.js

    I'd love some help here :)

    Thanks,

    Jordan

    bug 
    opened by jordanpapaleo 15
  • "Zoom to limits" functionality; fix #95

    A new method zoomToLimits is introduced to implement the feature of zooming into specified limits on the axes. The axes can be defined by their ids.

    The function takes a single object argument:

    {                                                    
        x: { min: 0, max: 10.1, axis_id: 'x-axis-1' },   
        y: { min: 1.34, max: 22.8, axis_id: 'y-axis-1' },
    }                                                    
    

    The axis id may be undefined, in this case the first x/y axis will be selected.

    An example of using the method is included in new file samples/zoom-to-limits.html.

    Also, parts of this PR are:

    • fix for #95 ("resetZoom() does not restore original min/max")
    • changes in range limiting functions that duplicate PR #99 (I discovered that PR after implementing the changes in my code..)

    NOTE: I haven't tested the new method against time and indexed scales. Please let me know if you see an error there.

    opened by vakorol 14
  • Pan is not working for Bar Chart, Zoom is however.

    Pan is not working for Bar Chart, Zoom is however.

    My barchart uses the chartjs-zoom plugin, however only the zoom functionality works.

    `$(document).ready(function () { $.getJSON( "@Url.Action("GetData")", function (data) { BarChart(data); }); });

                function BarChart(data) {
                    var barChartData = {
                        labels: data.Month,
                        datasets: [
                            {
                                label: 'Weight (kg)',
                                fillColor: "rgba(220,220,220,0.5)",
                                backgroundColor: "rgba(46, 44, 211, 0.7)",
                                highlightFill: "rgba(220,220,220,0.75)",
                                highlightStroke: "rgba(220,220,220,1)",
                                data: data.Weight
                            },
                            {
                                label: 'Steps',
                                fillColor: "rgba(0,0,0,0.5)",
                                backgroundColor: "rgba(215, 44, 44, 0.7)",
                                highlightFill: "rgba(0,0,0,0.5)",
                                highlightStroke: "rgba(0,0,0,0.5)",
                                data: data.Steps
                            }
                        ]
    
                    }
                    var ctx = document.getElementById("barchart").getContext("2d");
                    window.myBar =new Chart(ctx, {
                        type: 'bar',
                        data: barChartData,
                        options: {
                            pan: {
                                enabled: true,
                                mode: 'xy',
                                speed: 10,
                                threshold: 10
                            },
                            zoom: {
                                enabled: true,
                                mode: 'xy',
                                limits: {
                                    max: 1000,
                                    min: 0.5
                                }
                            },
                            responsive: true,
                            tooltips: {
                                callbacks: {
                                    afterLabel: function (e) { return "Owner: " + data.User[e.index] }
                                }
                            },
                            scales: {
                                yAxes: [{
                                    ticks: {
                                        beginAtZero: true
                                    }
                                }]
                            }
                        }
                    });
                    
                }`
    

    I have included: Script.Require("ChartJS"); Script.Require("ChartJSZoom"); Script.Require("Hammer"); and these requires contain the mins and regular packages for ChartJS, ChartJSZoom and Hammer.

    The barchart is in the canvas: <div id="container" style="width:1100px; overflow-x:scroll;"> <canvas id="barchart"></canvas> </div> Some insight into why this isn't working would be great, I have tried to use the codepen example as a starting point (however the pan doesn't work on that either for me!?): http://codepen.io/anon/pen/PGabEK

    The documentation is unfortunately unable to help with this issue also.

    Thanks to anyone who can help, I would just like basic horizontal panning, XY panning would just be a bonus :)

    bug help wanted 
    opened by bmomen 14
  • Chart.js 3.0 & Angular

    Chart.js 3.0 & Angular

    Hi,

    I'm currently working on an integration of Chart.js and the zoom plugin on an angular project, and everything was working fine with 2.9.4 & 0.7.7 respectively.

    Working code on Chart.js 2.9.4

    import { Chart, ChartData, ChartOptions, ChartPoint } from 'chart.js';
    import 'chartjs-plugin-zoom';
    
    {some code}
    
    options: {
      plugins: {
        zoom: {
          pan: {
            enabled: true,
            mode: 'x',
            rangeMin: { x: 0 },
            rangeMax: { x: 100 }
          },
          zoom: {
            enabled: true,
            mode: 'x',
            rangeMin: { x: 0 },
            rangeMax: { x: 100 }
          }
        }
      }
    }
    

    And it worked quite fine.

    As it appears that Chart recently officially launched v3, I tried to upgrade it as well, as it is way better integrated with typescript than the v2 (no need for a @type import, etc.)

    But there were a few hiccups during integration with plugin (I know it's still in beta). I've seen on JS files that the registration seems ok (chart_js.Chart.register(zoomPlugin);), but to in fact have it to work properly I had to also register it on my side:

    Working code on Chart.js 3.0.2

    import { Chart, ChartData, ChartDataset, ChartOptions, registerables } from 'chart.js';
    import * as ChartZoomPlugin from 'chartjs-plugin-zoom';
    
    Chart.register(...registerables, ChartZoomPlugin.Zoom);
    
    {some code}
    
    options: {
      plugins: {
        zoom: {
          pan: {
            enabled: true,
            mode: 'x',
            rangeMin: { x: 0 },
            rangeMax: { x: 100 }
          },
          zoom: {
            enabled: true,
            mode: 'x',
            rangeMin: { x: 0 },
            rangeMax: { x: 100 }
          }
        }
      }
    }
    

    Is it really the intended use/workaround to make it work in a Typescript way? The register part I mean

    types 
    opened by Nico-DF 13
  •  Does not use passive listeners to improve scrolling performance

    Does not use passive listeners to improve scrolling performance

    I got this during the diagnostics from the Chrome Lighthouse.

    Consider marking your touch and wheel event listeners as passive to improve your page's scroll performance. Learn more.

    opened by rabinadk1 0
  • Pan functionality in basic sample does not work in Chrome (107,108)

    Pan functionality in basic sample does not work in Chrome (107,108)

    The pan functionality in the basic sample https://www.chartjs.org/chartjs-plugin-zoom/samples/basic.html does not work in Chrome (v107, v108) it does work in Firefox. (this is under Ubuntu 20.04 amd64 running in VirtualBox under Windows 10)

    It also doesn't work in my code which uses

    • "chart.js": "^4.0.1"
    • "chartjs-plugin-zoom": "^2.0.0"
    • "hammerjs": "^2.0.8"
    opened by kk49 1
  • Zoom on mixed charts : scales may be unsynchronized

    Zoom on mixed charts : scales may be unsynchronized

    Hi,

    When zooming on mixed charts, scales may be unsynchronized. For example, if I have 2 scales :

    • x1: scatter data on linear scale ;
    • x2: bar data on category scale.

    When zooming, x1 will be zoomed smoothly, while x2 will be zoomed step by step (bar will not be show partially, it will either be shown in full or not shown).

    Therefore, if I have points at positions (0;2), (0.5;2), and (1;2) as well as a bar that is supposed to be in the [0;1[ abscissa range, the points should be respectively at the start, middle, and end of the bar (in the x direction). However, when zooming this may not be the case, as the zoom process is different between the 2 type of scales.

    I think an option should be added in order to specify the zoom behavior on category scales in order to enable them to be shown partially, therefore enabling to synchronize charts with multiples scales.

    Temporary what would you recommend me to do in order to synchronize this 2 scales while zooming (or panning).

    Cordially,

    opened by denis-migdal 7
  • Zoom incompatible with

    Zoom incompatible with "grace" option

    When using the grace option (options.scales[scaleId].grace) on the y axis, zooming and dezooming will not keep the correct aspect ratio of the y-scale and make the curve look flatter and flatter. Here’s a simple jsfiddle example: https://jsfiddle.net/n9j5gho1/

    opened by FlorentD42 0
  • Error [ERR_PACKAGE_PATH_NOT_EXPORTED]

    Error [ERR_PACKAGE_PATH_NOT_EXPORTED]

    With chart.js(4.0.1) getting this error - Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in D:\node_e_modules\chart.js\package.json

    opened by Hasan-dihaz 6
  • SwiftUI MKWebview not handling gestures

    SwiftUI MKWebview not handling gestures

    I'm not sure if this is an issue with the zoom plugin or with my MKWebView setup in SwiftUI but I made a chart that works everywhere except in MKWebView. If instructions for MKWebView could also be included somewhere that would be good, otherwise if it doesn't work I'm alerting a bug. https://stackoverflow.com/questions/74344519/the-chart-js-zoom-and-pan-plugin-is-not-working-in-wkwebview

    opened by CarlSchwarz 1
Releases(v2.0.0)
  • v2.0.0(Nov 23, 2022)

    Essential Links

    Breaking Changes

    • #658 Replace overScaleMode with more flexible scaleMode

    Enhancements

    • #672 Allow canceling drag-to-zoom on Escape key
    • #680 Add drawTime option to zoom drag configuration
    • #695 add-v4-compatibility
    • #671 Only drag zoom on left mouse button
    • #659 Export zoomRect and make it more configurable
    • #658 Replace overScaleMode with more flexible scaleMode

    Thanks to @LeeLenaleee, @dependabot, @dependabot[bot], @joshkel, @kurkle and @stockiNail

    Source code(tar.gz)
    Source code(zip)
    chartjs-plugin-zoom-2.0.0.tgz(19.61 KB)
    chartjs-plugin-zoom.js(30.97 KB)
    chartjs-plugin-zoom.min.js(12.68 KB)
  • v1.2.1(Mar 24, 2022)

  • v1.2.0(Nov 16, 2021)

  • v1.1.1(Jul 4, 2021)

  • v1.1.0(Jul 1, 2021)

    Essential Links

    Enhancements

    • #555 Add modifierKey option for drag-to-zoom
    • #536 Add getZoomLevel function
    • #524 Multi-axis zoom and original zoom limits

    Bugs Fixed

    • #557 Fix initial zoom level and pan with drag modifier
    • #553 Fix resetZoom after manual scale limits update
    • #544 Fix errors from zero-dimension scales
    • #541 Fix removing event listeners

    Types

    • #534 Documentation and type definitions for zoomFunctions and panFunctions

    Documentation

    • #558 Add fetch-data example
    • #547 Fix click to zoom sample
    • #534 Documentation and type definitions for zoomFunctions and panFunctions

    Development

    • #560 Bump version to 1.1.0

    Thanks to @joshkel and @kurkle

    Source code(tar.gz)
    Source code(zip)
    chartjs-plugin-zoom-1.1.0.tgz(15.88 KB)
    chartjs-plugin-zoom.js(28.26 KB)
    chartjs-plugin-zoom.min.js(11.25 KB)
  • v1.0.1(Jun 1, 2021)

  • v1.0.0(May 24, 2021)

    Essential Links

    :warning: Important note for users upgrading from version prior to 1.0.0-rc: the wheel/pinch/drag zoom behaviors are now configured separately, so some options have been moved an renamed:

    • zoom.enabled -> zoom.wheel.enabled and zoom.pinch.enabled
    • zoom.drag -> zoom.drag.enabled (enabling drag mode no longer disables the wheel/pinch modes)
    • zoom.speed -> zoom.wheel.speed
    • zoom.wheelModifierKey -> zoom.wheel.modifierKey
    • zoom.threshold -> zoom.drag.threshold

    Breaking Changes

    • #507 Add the ability to enable both wheel and drag modes at the same time
    • #478 Add zoomScale, rename doPan to pan, doZoom to zoom
    • #476 Fix category panning
    • #470 Combine range options, add minimum scale range

    Enhancements

    • #487 Add onPanStart and onZoomStart callbacks
    • #484 Drag-to-zoom: filter clicks and pan.modifierKey
    • #483 Make resetZoom accept UpdateMode argument
    • #478 Add zoomScale, rename doPan to pan, doZoom to zoom
    • #481 Expose zoomFunctions and panFunctions for customization
    • #464 Refactor & export pan and zoom functions
    • #457 Internal state handling
    • #399 Feature: Zoom each scale separately
    • #382 Added optional modifier keys
    • #414 Add an ESM build
    • #411 Use `start` and `stop` plugin hooks instead of `beforeInit`, `afterInit` and `destroy`
    • #408 Compatible with Chart.js 3.0.0-beta7
    • #390 Porting to CHART.JS 3 (using master)

    Bugs Fixed

    • #512 Fix drag threshold for single axis modes
    • #504 Fixes invalid context onZoomComplete invocation
    • #502 Add missing modifierKey properties to Options
    • #495 Cancel all chart events while panning or dragging
    • #494 Fix delta calculation at direction change
    • #488 Fix drag-zoom and pan for non-linear scales
    • #484 Drag-to-zoom: filter clicks and pan.modifierKey
    • #485 Fix calling of onZoomComplete from wheel event
    • #476 Fix category panning
    • #474 Use static offsets for panning rounded time scale
    • #472 Fix hook parameters
    • #455 Refactor startHammer
    • #451 Remove animationDuration option
    • #429 Fix non-zoomable charts eating scroll events
    • #434 Fix zoom on category scale
    • #410 Properly call onZoom & onZoomComplete when pinching

    Types

    • #502 Add missing modifierKey properties to Options
    • #469 Add missing return types
    • #439 Reuse types from Chart.ts
    • #438 adding typings for Zoom analog to chartjs-plugin-annotation

    Documentation

    • #505 Remove speed property from pan options in the samples
    • #501 Adds note to click zoom sample
    • #497 Adds drag effect options to the documentation
    • #486 Add click-to-zoom example
    • #477 Add API documentation (typedoc)
    • #475 Add a sample for drag-to-zoom in docs
    • #515 Removes 'undefined' as default because is not undefined
    • #467 Fix minor typo errors in docs
    • #466 Remove API section in README
    • #462 Add sample on time scale
    • #463 Correct zoom modifierKey docs
    • #461 Changes zoom.threshold default to 0
    • #459 Update README
    • #456 Add initial docs
    • #428 Changes script URLs for chart.js and hammer in order to use node_modules

    Development

    • #518 Bump version to 1.0, update dependencies
    • #488 Fix drag-zoom and pan for non-linear scales
    • #455 Refactor startHammer
    • #454 Use fallback configration for scale types
    • #452 Refactor to logical entities
    • #416 Remove Bower
    • #365 Fix no-mixed-operators lint warnings
    Source code(tar.gz)
    Source code(zip)
    chartjs-plugin-zoom-1.0.0.tgz(14.62 KB)
    chartjs-plugin-zoom.js(25.84 KB)
    chartjs-plugin-zoom.min.js(10.25 KB)
  • v1.0.0-rc(May 17, 2021)

    Essential Links

    • #501 Adds note to click zoom sample
    • #497 Adds drag effect options to the documentation

    :warning: Important note for users upgrading from previous versions: the wheel/pinch/drag zoom behaviors are now configured separately, so some options have been moved an renamed:

    • zoom.enabled -> zoom.wheel.enabled and zoom.pinch.enabled
    • zoom.drag -> zoom.drag.enabled (enabling drag mode no longer disables the wheel/pinch modes)
    • zoom.speed -> zoom.wheel.speed
    • zoom.wheelModifierKey -> zoom.wheel.modifierKey
    • zoom.threshold -> zoom.drag.threshold

    Breaking Changes

    • #507 Add the ability to enable both wheel and drag modes at the same time

    Enhancements

    • #507 Add the ability to enable both wheel and drag modes at the same time

    Bugs Fixed

    • #512 Fix drag threshold for single axis modes
    • #504 Fixes invalid context onZoomComplete invocation
    • #502 Add missing modifierKey properties to Options
    • #495 Cancel all chart events while panning or dragging
    • #494 Fix delta calculation at direction change

    Types

    • #502 Add missing modifierKey properties to Options

    Documentation

    • #505 Remove speed property from pan options in the samples

    Development

    • #513 Bump version to 1.0.0-rc, update dependencies

    Thanks to @jbelien, @jledentu, @kurkle and @stockiNail

    Source code(tar.gz)
    Source code(zip)
    chartjs-plugin-zoom-1.0.0-rc.tgz(14.63 KB)
    chartjs-plugin-zoom.js(25.84 KB)
    chartjs-plugin-zoom.min.js(10.25 KB)
  • v1.0.0-beta.5(May 2, 2021)

    Essential Links

    Enhancements

    • #487 Add onPanStart and onZoomStart callbacks
    • #484 Drag-to-zoom: filter clicks and pan.modifierKey
    • #483 Make resetZoom accept UpdateMode argument

    Bugs Fixed

    • #488 Fix drag-zoom and pan for non-linear scales
    • #484 Drag-to-zoom: filter clicks and pan.modifierKey
    • #485 Fix calling of onZoomComplete from wheel event

    Documentation

    • #486 Add click-to-zoom example

    Development

    • #490 Bump version to 1.0.0-beta.5
    • #488 Fix drag-zoom and pan for non-linear scales

    Thanks to @kurkle and @nagix

    Source code(tar.gz)
    Source code(zip)
    chartjs-plugin-zoom-1.0.0-beta.5.tgz(14.33 KB)
    chartjs-plugin-zoom.js(25.39 KB)
    chartjs-plugin-zoom.min.js(9.95 KB)
  • v1.0.0-beta.4(Apr 30, 2021)

    Essential Links

    Breaking Changes

    • #478 Add zoomScale, rename doPan to pan, doZoom to zoom
    • #476 Fix category panning

    Enhancements

    • #478 Add zoomScale, rename doPan to pan, doZoom to zoom
    • #481 Expose zoomFunctions and panFunctions for customization

    Bugs Fixed

    • #476 Fix category panning
    • #474 Use static offsets for panning rounded time scale

    Documentation

    • #477 Add API documentation (typedoc)
    • #475 Add a sample for drag-to-zoom in docs

    Development

    • #482 Bump version to 1.0.0-beta.4

    Thanks to @jledentu, @kurkle and @nagix

    Source code(tar.gz)
    Source code(zip)
    chartjs-plugin-zoom-1.0.0-beta.4.tgz(13.21 KB)
    chartjs-plugin-zoom.js(22.27 KB)
    chartjs-plugin-zoom.min.js(8.67 KB)
  • v1.0.0-beta.3(Apr 27, 2021)

    Essential Links

    • #466 Remove API section in README

    Breaking Changes

    • #470 Combine range options, add minimum scale range

    Enhancements

    • #470 Combine range options, add minimum scale range

    Bugs Fixed

    • #472 Fix hook parameters

    Types

    • #469 Add missing return types

    Documentation

    • #467 Fix minor typo errors in docs

    Development

    • #473 Bump version to beta.3

    Thanks to @jledentu and @kurkle

    Source code(tar.gz)
    Source code(zip)
    chartjs-plugin-zoom-1.0.0-beta.3.tgz(12.40 KB)
    chartjs-plugin-zoom.js(20.79 KB)
    chartjs-plugin-zoom.min.js(8.19 KB)
  • v1.0.0-beta.2(Apr 25, 2021)

    Essential Links

    Enhancements

    • #464 Refactor & export pan and zoom functions
    • #457 Internal state handling
    • #399 Feature: Zoom each scale separately
    • #382 Added optional modifier keys

    Bugs Fixed

    • #455 Refactor startHammer
    • #451 Remove animationDuration option
    • #429 Fix non-zoomable charts eating scroll events
    • #434 Fix zoom on category scale

    Types

    • #439 Reuse types from Chart.ts
    • #438 adding typings for Zoom analog to chartjs-plugin-annotation

    Documentation

    • #462 Add sample on time scale
    • #463 Correct zoom modifierKey docs
    • #461 Changes zoom.threshold default to 0
    • #459 Update README
    • #456 Add initial docs

    Development

    • #465 Bump version to 1.0.0-beta.2
    • #455 Refactor startHammer
    • #454 Use fallback configration for scale types
    • #452 Refactor to logical entities

    Thanks to @BarryPSmith, @benmccann, @etimberg, @jacopotediosi, @jledentu, @kurkle, @lirik90, @stockiNail and @tomsoftware

    Source code(tar.gz)
    Source code(zip)
    chartjs-plugin-zoom-1.0.0-beta.2.tgz(12.52 KB)
    chartjs-plugin-zoom.js(21.10 KB)
    chartjs-plugin-zoom.min.js(8.22 KB)
  • v1.0.0-beta.1(Mar 8, 2021)

    Essential Links

    Enhancements

    • #414 Add an ESM build
    • #411 Use `start` and `stop` plugin hooks instead of `beforeInit`, `afterInit` and `destroy`
    • #408 Compatible with Chart.js 3.0.0-beta7
    • #390 Porting to CHART.JS 3 (using master)

    Bugs Fixed

    • #410 Properly call onZoom & onZoomComplete when pinching

    Documentation

    • #428 Changes script URLs for chart.js and hammer in order to use node_modules

    Development

    • #416 Remove Bower
    • #365 Fix no-mixed-operators lint warnings

    Thanks to @benmccann, @ccrisan, @joshkel, @kurkle, @qcho and @stockiNail

    Source code(tar.gz)
    Source code(zip)
    chartjs-plugin-zoom-1.0.0-beta.1.tgz(11.30 KB)
    chartjs-plugin-zoom.js(22.99 KB)
    chartjs-plugin-zoom.min.js(9.19 KB)
  • v0.7.0(Mar 16, 2019)

    Breaking Changes

    • The dependency on Chart.js is now declared as a peerDependency. This means that chart.js will need to be installed alongside chartjs-plugin-zoom
    • update must be called after changing options

    Bug Fixes

    • Fix pan at limits of range (https://github.com/chartjs/chartjs-plugin-zoom/pull/211)
    • Fix range min and max when zooming time scale (https://github.com/chartjs/chartjs-plugin-zoom/pull/208)
    • Fix errors when only pan is enabled (https://github.com/chartjs/chartjs-plugin-zoom/pull/212)
    • Make resetZoom work with added scales (https://github.com/chartjs/chartjs-plugin-zoom/pull/201). Thanks @jannisgt
    • Don't delete dataset._meta (https://github.com/chartjs/chartjs-plugin-zoom/pull/204)
    • Ensure pan works when zoom is disabled (https://github.com/chartjs/chartjs-plugin-zoom/pull/203)
    • Fix pan on category scale when offsetGridLines=false (#198)
    • Fix the calculation of the zoom center coordinate when dragging (#161). Thanks @nagix
    • Fix mouseup outside chart element (#150). Thanks @jledentu
    • Options can now be specified under plugins.zoom (https://github.com/chartjs/chartjs-plugin-zoom/pull/221)

    Enhancements

    • Speed option (https://github.com/chartjs/chartjs-plugin-zoom/pull/215). Thanks @jledentu
    • Allow switching between wheel/drag modes of the zoom (#196). Thanks @jledentu
    • Added onZoom / onPan args (https://github.com/chartjs/chartjs-plugin-zoom/pull/178). Thanks @Techn1x
    • Add options to customize drag-to-zoom area (#148). Thanks @jledentu
    • Enable zoom on vertical axis. Thanks @jledentu

    Docs

    • Improve readme and samples (https://github.com/chartjs/chartjs-plugin-zoom/pull/210)
    • Added jsdoc for doZoom (https://github.com/chartjs/chartjs-plugin-zoom/pull/192)

    Dev and Infra

    • Automated release process (https://github.com/chartjs/chartjs-plugin-zoom/pull/202). Thanks @jledentu
    • Use rollup to build the library (https://github.com/chartjs/chartjs-plugin-zoom/pull/193). Thanks @jledentu
    • Linting of samples (https://github.com/chartjs/chartjs-plugin-zoom/pull/194)
    • Linting of code
    Source code(tar.gz)
    Source code(zip)
    chartjs-plugin-zoom.js(20.27 KB)
    chartjs-plugin-zoom.min.js(8.83 KB)
    chartjs-plugin-zoom.zip(16.65 KB)
  • v0.6.6(Mar 5, 2019)

  • v0.6.2(Mar 5, 2019)

  • v0.5.0(May 22, 2017)

    Enhancements

    • Support added for zoom and pan limits (#37) - thanks @bjornnorman

    Issues Fixed

    • Documented chartInstance.resetZoom() method (#68)
    • Documented zoom.drag option
    • Fixed broken link to CONTRIBUTING.md (#71)
    Source code(tar.gz)
    Source code(zip)
  • v0.4.6(Mar 22, 2017)

  • v0.4.4(Nov 29, 2016)

  • v0.4.3(Nov 21, 2016)

  • v0.4.1(Nov 17, 2016)

    Enhancements

    • zoomPlugin is now exported as a proper module - #55 (resolves #16)

    Issues Fixed

    • Fixed a Javascript error when the chart is destroyed - #56 (resolves #54)
    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Oct 23, 2016)

    Plugin Name Changed

    Starting with this version, the plugin name has changed from 'Chart.Zoom.js' to 'chartjs-plugin-zoom'. Old versions are still available on NPM. New versions will be published under the new name only

    This change was made to make it easier to search plugins for Chart.js on npm.

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Oct 18, 2016)

    Enhancements

    • Ability to zoom category axes #39 Thanks @QuantumBob
    • Panning of category axes #33 Thanks @QuantumBob

    Issues Fixed

    • Prevent page scrolling on mousewheel #36 Thanks @johnvarv
    • Check if options.zoom exists before reading #44 Thanks @gormanb
    • Add link to live demo in readme #47 Thanks @zachpanz88
    • Fixed drag-zoom when canvas has margins / padding #38 Thanks @skuhoo and @niutski
    Source code(tar.gz)
    Source code(zip)
Owner
Chart.js
Simple, clean and engaging charts for designers and developers
Chart.js
Chart.js plugin to defer initial chart updates

Chart.js plugin to defer initial chart updates until the user scrolls and the canvas appears inside the viewport, and thus trigger the initial chart a

Chart.js 97 Nov 9, 2022
A Simple Dashboard Chart in Laravel Nova using Chart JS

A Simple Dashboard Chart in Laravel Nova using Chart JS. Starting create your own dashboard with Chart JS Integration can save your time and help you maintain consistency across standard elements such as Bar, Stacked, Line, Area, Doughnut and Pie Chart.

Kuncoro Wicaksono 177 Jan 4, 2023
Bar Funnel Chart extension for Chart.js

Chart.BarFunnel.js Provides a Bar Funnel Chart for use with Chart.js Documentation To create a Bar Funnel Chart, include Chart.BarFunnel.js after Char

Chart.js 58 Nov 24, 2022
TradeX-chart is a trade chart written in plain (vanilla) JavaScript with minimal dependencies

TradeX-chart is a trade chart written in plain (vanilla) JavaScript with minimal dependencies; use it with any framework or backend.

null 24 Dec 12, 2022
Chart.js plugin to calculate and draw statistical linear, exponential, power, logarithmic, and polynomial regressions.

chartjs-plugin-regression Chart.js plugin to calculate and draw statistical linear, exponential, power, logarithmic, and polynomial regressions using

Wilfredo Pomier 14 Dec 18, 2022
Chart.js plugin for more styling options

chartjs-plugin-style Chart.js plugin for more styling options This plugin requires Chart.js 2.6.0 or later. Installation You can download the latest v

Akihiko Kusanagi 57 Oct 27, 2022
Chart.js plugin for live streaming data

chartjs-plugin-streaming Chart.js plugin for live streaming data chartjs-plugin-streaming 2.x requires Chart.js 3.0.0 or later. If you need Chart.js 2

Akihiko Kusanagi 401 Dec 27, 2022
Chart.js plugin to create charts with a hand-drawn, sketchy, appearance

chartjs-plugin-rough Chart.js plugin to create charts with a hand-drawn, sketchy, appearance Version 0.2 requires Chart.js 2.7.0 or later, and Rough.j

Akihiko Kusanagi 73 Dec 1, 2022
Draggable data points plugin for Chart.js

chartjs-plugin-dragdata.js Now compatible with Chart.js v3 ?? Looking for a version compatible to Chart.js < 2.9.x? Then visit the v2 branch! A plugin

Christoph Pahmeyer 196 Dec 18, 2022
Chart.js plugin for Prometheus data loading

Welcome to chartjs-plugin-datasource-prometheus ?? A Prometheus datasource for ChartJS. Dependencies: requires chart.js 2.7 or later. requires moment.

Samuel Berthe 77 Dec 6, 2022
Chart.js plugin to display labels on data elements

Overview Highly customizable Chart.js plugin that displays labels on data for any type of charts. Requires Chart.js 3.x. Documentation Introduction Ge

Chart.js 753 Dec 24, 2022
Annotation plugin for Chart.js

chartjs-plugin-annotation.js An annotation plugin for Chart.js >= 3.0.0 This plugin needs to be registered. It does not function as inline plugin. For

Chart.js 515 Dec 30, 2022
TChart.js - simple and configurable Bar and Line Chart library in Javascript

TChart.js Simple and configurable Bar and Line Chart library in Javascript Description TChart.js is a canvas-based simple Javascript Bar and Line Char

null 4 Mar 3, 2021
Redefined chart library built with React and D3

Recharts Introduction Recharts is a Redefined chart library built with React and D3. The main purpose of this library is to help you to write charts i

recharts 19.4k Jan 2, 2023
Chart image and QR code web API

QuickChart QuickChart is a service that generates images of charts from a URL. Because these charts are simple images, they are very easy to embed in

Ian Webster 1.3k Dec 25, 2022
J2CL and GWT Charts library based on CHART.JS

Charba - J2CL and GWT Charts library based on CHART.JS What's Charba GWT Web toolkit doesn't have charting library available out of the box. There are

Pepstock.org 56 Dec 17, 2022
Chart.js Venn and Euler Diagrams

Chart.js Venn and Euler Diagram Chart Chart.js module for charting venn diagrams with up to five sets. Adding new chart type: venn and euler. Related

UpSet.js 23 Dec 6, 2022
Chart.js Choropleth and Bubble Maps

Chart.js Geo Chart.js module for charting maps with legends. Adding new chart types: choropleth and bubbleMap. works great with https://github.com/cha

Samuel Gratzl 224 Dec 28, 2022
Chart.js Box Plots and Violin Plot Charts

Chart.js Box and Violin Plot Chart.js module for charting box and violin plots. This is a maintained fork of @datavisyn/chartjs-chart-box-and-violin-p

Samuel Gratzl 61 Dec 14, 2022