Chart.Funnel.js icon indicating copy to clipboard operation
Chart.Funnel.js copied to clipboard

tooltip is not working when I include chart.funnel.js along chartJS 2.5 bundle.js

Open mitrin359 opened this issue 8 years ago • 5 comments

I dont know what is the problem but I'm facing a lot of issues when I combine both, Initially I created my charts with the basic ones provided in chartJS, and they are all configured how I want colors, tooltip, cursor change etc, Now when I include Chart.funnel.js my tooltip doesn't work, but at the same time other basic charts tooltip is working, Can you please help me how to solve this. Thank you

mitrin359 avatar May 04 '17 12:05 mitrin359

I'm also having the same problem with chartJS 2.6. When I examine the console while hovering the mouse over the funnel, I a series of the this same error. Here is the console log error (for brevity, I removed the long cdn address and replaced it with 'mycdn') Chart.bundle.min.js:14 Uncaught TypeError: t.getCenterPoint is not a function at https://mycdn/Chart.js-2.6.0/dist/Chart.bundle.min.js:14:4857 at n (https://mycdn/Chart.js-2.6.0/dist/Chart.bundle.min.js:14:4624) at a (https://mycdn/Chart.js-2.6.0/dist/Chart.bundle.min.js:14:4806) at nearest (https://mycdn/Chart.js-2.6.0/dist/Chart.bundle.min.js:14:5635) at t.getElementsAtEventForMode (https://mycdn/Chart.js-2.6.0/dist/Chart.bundle.min.js:13:15999) at n.handleEvent (https://mycdn/Chart.js-2.6.0/dist/Chart.bundle.min.js:15:893) at t.eventHandler (https://mycdn/Chart.js-2.6.0/dist/Chart.bundle.min.js:13:17924) at n (https://mycdn/Chart.js-2.6.0/dist/Chart.bundle.min.js:13:17272) at HTMLCanvasElement.s.(anonymous function) (https://mycdn/Chart.js-2.6.0/dist/Chart.bundle.min.js:15:10051)

hisenberg1 avatar Jun 08 '17 22:06 hisenberg1

Update: I changed /chart.funnel.min.js to /chart.funnel.bundled.js and now the tooltips work. The bundled version appears to load the older version of Chart.js which just confirms the conflict in the new version.

hisenberg1 avatar Jun 08 '17 23:06 hisenberg1

SOLVED: Add the following to the end of the chart.funnel.js (chart.funnel.min.js) at the end of the file right before tooltipPosition: function() {...

		getCenterPoint: function () {
		    var vm = this._view;
		    return {
		        x: vm.x,
		        y: vm.y
		    };
		},

hisenberg1 avatar Jun 09 '17 20:06 hisenberg1

I have this problem too. Firstly - I cant import this plugin with browserify. I tried to import from npm, from bower with other variants. I solve the import by copying all src folders into the folder of my component. I found tooltipPosition: function () into the element.trapezium.js but return { x: vm.x, y: vm.y }; not working for me. "element.getCenterPoint is not a function"

WebKieth avatar Nov 24 '17 13:11 WebKieth

I tried to playing with other versions - chart.js 2.3.0 still works with funnel, 2.4.0 - isn't

WebKieth avatar Nov 24 '17 14:11 WebKieth