xch89820 / Chart.Funnel.js

The funnel plugins for Chart.js 2.0
MIT License
33 stars 57 forks source link

TypeError: element.getCenterPoint is not a function #7

Open ryzhak opened 6 years ago

ryzhak commented 6 years ago

Hi, thank you for this great extension.

I can't run the demo example in my angular 4 application. Getting the following error on chart hover: "ERROR TypeError: element.getCenterPoint is not a function"

The issue arises when I'm NOT using bundled js. So I import the following files: "../node_modules/chart.js/dist/Chart.js", "../node_modules/chartjs-funnel/dist/chart.funnel.js"

screenshot from 2017-07-27 10 49 41

What am I doing wrong?

ryzhak commented 6 years ago

Dirty hack: add the following code at the bottom of chart.funnel.js file before tooltipPosition function: getCenterPoint: function () { var vm = this._view; return { x: vm.x, y: vm.y }; },