Using zoom plugin for chart.js in Ionic

I was trying to use the chart.js zoom plugin for my chart.js charts but I cannot seem to get it to work. I’ve installed it and have tried importing it but that didn’t work. The gitlab for the plugin says to add it to the chart.js configuration but I cannot seem to find that. Has anyone used plugins for chart.js?

1 Like

Could you provide some links to the plugins you are talking about?

I am using https://github.com/chartjs/chartjs-plugin-zoom but just found my issue. I needed to import the plugin to my page like this: import ‘chartjs-plugin-zoom’;

2 Likes

Hey @akaraali, any chance you could post your code? I’ve been trying to get that library working in Ionic 2 but haven’t had any luck. Thanks.

Nevermind @akaraali, just realised it is a bug in V2.6.0 of chart.js which broke x axis pan and zoom which was causing me the issues. I downgraded to V2.5.0 and now it’s all working.

Thank you! I had a similar problem and i solved in this way!

import ‘chartjs-plugin-zoom’; in app.module.ts and it works

Can anyone put some sample code to implement zoom on chart options?, I add the plugin and import to the app.module.ts, but then I put in options shows me an error. cannot find name zoom