chartjs-plugin-crosshair icon indicating copy to clipboard operation
chartjs-plugin-crosshair copied to clipboard

compatibility with chart.js 3.0

Open rashearth opened this issue 4 years ago • 18 comments

Hi, Thanks for this wonderfull app, its really great to use. I have one request. Since the chart.js 3.0 is ongoing in good condition, it would be wonderful if you could make it compatible on Chart.js 3.0 as well.

Could you please work it out on it?

Thank you & Regards, Rashearth

rashearth avatar Nov 22 '20 05:11 rashearth

Hi, the chart.js 3.0 beta have launched version9! If possible , could you kindly work out the compatibility?

Just a gentle reminder!

rashearth avatar Jan 23 '21 13:01 rashearth

Hi, this is just a gentle reminder, is this script now compatible with chart.js > 3.0?

Best Regards, Rashearth

rashearth avatar May 03 '21 03:05 rashearth

This project looks dead to me sadly

Yohandah avatar Jun 24 '21 09:06 Yohandah

Man this plugin would be really nice to have right about now

marcusnewton avatar Jun 30 '21 11:06 marcusnewton

@marcusnewton I've added a chartjs3 branch with some preliminary fixes to support ChartJS 3.4. I have some issues with syncing zoom events that I still need to fix though. Can you check if that version is working for you?

AbelHeinsbroek avatar Jun 30 '21 11:06 AbelHeinsbroek

@AbelHeinsbroek I tried it but you don't seem to be using the latest version of Chartjs https://github.com/AbelHeinsbroek/chartjs-plugin-crosshair/blob/chartjs3/package.json#L47

marcusnewton avatar Jun 30 '21 12:06 marcusnewton

Whoops. Mind trying again?

AbelHeinsbroek avatar Jun 30 '21 13:06 AbelHeinsbroek

@AbelHeinsbroek I'm honestly just getting Chart.register is not a function here https://github.com/AbelHeinsbroek/chartjs-plugin-crosshair/blob/chartjs3/src/trace.js#L550

marcusnewton avatar Jul 01 '21 04:07 marcusnewton

Perhaps it should be imported as an ES module

marcusnewton avatar Jul 01 '21 04:07 marcusnewton

hi @marcusnewton would you mind trying again?

AbelHeinsbroek avatar Jul 02 '21 10:07 AbelHeinsbroek

@AbelHeinsbroek can't test right now but i'll get back to you :)

marcusnewton avatar Jul 02 '21 11:07 marcusnewton

@AbelHeinsbroek @marcusnewton I just added PR #78 that adds a GitHub Action to build the plugin. This way the plugin can be tested without having npm or the build tools installed. I tested the build output, and the plugin works, together with Chart.js 3.4.0. I'm only using the crosshair, not zooming or panning, though.

vividos avatar Jul 02 '21 18:07 vividos

Yeah I dunno why this doesn't work for me. Everything builds fine, I import the plugin into my Svelte component but don't see crosshair in the plugins registry. Again, I would probably suggest updating the usage to work as an ES module import, letting the user register the plugin themselves. There might be some compatibility issues when using this current version with certain module bundlers like rollup, but I'm not sure. I don't have much experience sharing custom modules, sorry.

marcusnewton avatar Jul 05 '21 04:07 marcusnewton

@AbelHeinsbroek I checked the chartjs3 branch and it seems the change from PR #49 still needs to be applied there (it's just a typo when checking xScaleType.

vividos avatar Jul 15 '21 20:07 vividos

Don't mind my last comment, the change is already in the master branch. As 1.2.0 is compatible with chart.js, I think this ticket can be closed.

vividos avatar Oct 27 '21 09:10 vividos

Yeah I dunno why this doesn't work for me. Everything builds fine, I import the plugin into my Svelte component but don't see crosshair in the plugins registry.

I’m having the same issue with this plugin v1.2.0 in an Angular implementation with rollup.

'crosshair' does not exist in type '_DeepPartialObject<PluginOptionsByType<keyof ChartTypeRegistry>>'

DaveSkender avatar Oct 27 '21 14:10 DaveSkender

Yeah I dunno why this doesn't work for me. Everything builds fine, I import the plugin into my Svelte component but don't see crosshair in the plugins registry.

I’m having the same issue with this plugin v1.2.0 in an Angular implementation with rollup.

'crosshair' does not exist in type '_DeepPartialObject<PluginOptionsByType>'

Have you solved the issue ?

roma2341 avatar Apr 25 '22 15:04 roma2341

Nope. I turned it off. It's either internally not registered correctly with newer Chart.js versions, or there's some TypeScript incompatibility or missing typings issue. I've not tried to find a fix to contribute here either. The Owner is slow to respond or not actively managing this project, from what I can see.

DaveSkender avatar Apr 25 '22 17:04 DaveSkender