AbelHeinsbroek / chartjs-plugin-crosshair

Crosshair plugin for ChartJS
https://chartjs-plugin-crosshair.netlify.com/samples/
MIT License
152 stars 86 forks source link

compatibility with chart.js 3.0 #58

Open rashearth opened 4 years ago

rashearth commented 4 years ago

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 commented 3 years ago

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

Just a gentle reminder!

rashearth commented 3 years ago

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

Best Regards, Rashearth

Yohandah commented 3 years ago

This project looks dead to me sadly

marcusnewton commented 3 years ago

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

AbelHeinsbroek commented 3 years ago

@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?

marcusnewton commented 3 years ago

@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

AbelHeinsbroek commented 3 years ago

Whoops. Mind trying again?

marcusnewton commented 3 years ago

@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 commented 3 years ago

Perhaps it should be imported as an ES module

AbelHeinsbroek commented 3 years ago

hi @marcusnewton would you mind trying again?

marcusnewton commented 3 years ago

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

vividos commented 3 years ago

@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.

marcusnewton commented 3 years ago

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.

vividos commented 3 years ago

@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 commented 3 years ago

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.

DaveSkender commented 3 years ago

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>'

roma2341 commented 2 years ago

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'

Have you solved the issue ?

DaveSkender commented 2 years ago

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.