No x-axis pan or zoom using Chart.js 2.6.0
See original GitHub issuechartjs-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 chart.js@2.5.0
x-axis panning and zooming starts working again immediately. Running npm install chart.js@2.6.0
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
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:36 (10 by maintainers)
Top Results From Across the Web
Chartjs-plugin-zoom plugin does not change x axis labels
js module in order to plot some data and am using the chartjs-plugin-zoom in order to enable zooming and panning however although the...
Read more >Options | chartjs-plugin-zoom
A zoom and pan plugin for Chart.js >= 3.0.0. ... The options are split in three sub-objects, limits, pan and zoom.
Read more >Chartjs-Plugin-Zoom Plugin Does Not Change X ... - ADocLib
Plugin that enables zoom and pan functionality in Chart.js charts. Panning can be done via the mouse or with a finger. Zooming is...
Read more >chartjs-plugin-zoom - npm
Plugin that enables zoom and pan functionality in Chart.js charts.. Latest version: 2.0.0, last published: a month ago.
Read more >chartjs zoom, chartjs highlight range, chart js datepicker, chart ...
chartjs -plugin-zoom. A zoom and pan plugin for Chart.js. Currently requires Chart.js >= 2.6.0. Panning can be done via the mouse or with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had the same problem with time x axis. After some investigation, it seems that
firstTick
andlastTick
is no longer available on theChartElement
object. Instead, the pan function for time needs to manually index into the ticks array to get bothfirstTick
andlastTick
. I am working on a patch, and will test if this solves the problems for2.6.0
.Also, figured out why the axis ticks were not updating when zooming in - the ticks are being built before the options.time.min and max are taken into account.
Editing the release build of Chart.js “buildTicks” (line ~13844) function to move the following lines:
Just after this one:
Then the ticks update as you would expect.