Git Product home page Git Product logo

Comments (22)

Robloche avatar Robloche commented on July 18, 2024 7

@Dola97 If you're still interested, I forked the project and fixed this issue. I also bumped all dependencies versions.

https://www.npmjs.com/package/@robloche/chartjs-plugin-streaming

from chartjs-plugin-streaming.

Robloche avatar Robloche commented on July 18, 2024 1

Yes, that's obviously what I did. But that's not sustainable.

from chartjs-plugin-streaming.

Robloche avatar Robloche commented on July 18, 2024 1

Looking at the code of this plugin and chartjs, it seems that the plugin uses a deprecated event to clean everything: destroy.
From Chartjs' doc, it appears the correct event is now: afterDestroy.

from chartjs-plugin-streaming.

Robloche avatar Robloche commented on July 18, 2024 1

For some reason, I wasn't notified of these waiting PR...
I merged yours, thanks!

from chartjs-plugin-streaming.

Robloche avatar Robloche commented on July 18, 2024 1

I've just released v3.1.0 which includes your fix.

from chartjs-plugin-streaming.

kogratte avatar kogratte commented on July 18, 2024 1

If like me you don't like to use something else than the official package (which seems unmaintained, Robloche is right), you can fix this issue with something like that:

const chart = ref<LineController | null>(null);

onBeforeUnmount(() => {
    if (chart.value !== null) {
        chart.value.chart.notifyPlugins('destroy');
        chart.value.chart.destroy();
    }
});

from chartjs-plugin-streaming.

Robloche avatar Robloche commented on July 18, 2024

Is this project even maintained?

from chartjs-plugin-streaming.

Dola97 avatar Dola97 commented on July 18, 2024

Did You Find Any Solution @Robloche

from chartjs-plugin-streaming.

Robloche avatar Robloche commented on July 18, 2024

Unfortunately, no.
I'd like to give a try at fixing it myself but I'm afraid there would be nobody to approve my PR... 😔

from chartjs-plugin-streaming.

Dola97 avatar Dola97 commented on July 18, 2024

I find a temporary solution just downgrade the chart js version and it will work

from chartjs-plugin-streaming.

Dola97 avatar Dola97 commented on July 18, 2024

Thanks Appreciate it 😍😍

from chartjs-plugin-streaming.

SID9-HoneyBee avatar SID9-HoneyBee commented on July 18, 2024

@Robloche
You are referring to the 3.0.4 version you are working on.

could you please help me?

Even the 2.0.0 version has the same problem.

I made a sample using simple chart.js and chartjs-plugin-streaming.

When I hover over the chart, I get Cannot read properties 'getDatasetMeta' error.

Have you ever had this experience?

This happens when using the latest version(4.*) of chart.js .

from chartjs-plugin-streaming.

Robloche avatar Robloche commented on July 18, 2024

@Robloche You are referring to the 3.0.4 version you are working on.
could you please help me?
Yes. Since this project does not seem to be maintained any longer, I forked it and fixed the destroy issue.

Even the 2.0.0 version has the same problem.
I made a sample using simple chart.js and chartjs-plugin-streaming.
When I hover over the chart, I get Cannot read properties 'getDatasetMeta' error.
Have you ever had this experience?
Nope, sorry. I don't use this feature.

If you want to give it a try, fix it and create a PR on my forked project.

from chartjs-plugin-streaming.

SID9-HoneyBee avatar SID9-HoneyBee commented on July 18, 2024

@Robloche
Thank you for answer. I don't have the experience of forking a project and modifying and applying it yet. But I'll give it a try with your 3.0.4 version.

from chartjs-plugin-streaming.

Robloche avatar Robloche commented on July 18, 2024

You don't have to fork it.
Just clone my forked project, fix your issue, and submit a pull request.
Or at least, tell me what to change and I'll do the PR myself.

from chartjs-plugin-streaming.

SID9-HoneyBee avatar SID9-HoneyBee commented on July 18, 2024

@Robloche
I forked your project.

I am using chart.js 4.1.1 version and also using vue-chartjs.

Your repo has a closed issues section.

So we communicate here.

The realtime chart works fine, but the tooltip doesn't appear when I hover over it, and it says getDatasetMeta is undefined.

And I reproduced and corrected the problem.

Can I add a branch and request a PR?

from chartjs-plugin-streaming.

Robloche avatar Robloche commented on July 18, 2024

Sure.

from chartjs-plugin-streaming.

Robloche avatar Robloche commented on July 18, 2024

(I opened the "issues" section, btw.)

from chartjs-plugin-streaming.

jsteenkamp avatar jsteenkamp commented on July 18, 2024

@Robloche - thanks for fixing this issue with your fork.

There are 2 PRs on your fork that fix tooltips - without tooltip fix installing your fork fixes the unmount problem but breaks ChartJS tooltips.

from chartjs-plugin-streaming.

jsteenkamp avatar jsteenkamp commented on July 18, 2024

@Robloche many thanks

from chartjs-plugin-streaming.

thangnq1007 avatar thangnq1007 commented on July 18, 2024

For now, we were using Chartjs 3.9.1 and it still has that problem. @Robloche can you help me?

from chartjs-plugin-streaming.

Robloche avatar Robloche commented on July 18, 2024

For now, we were using Chartjs 3.9.1 and it still has that problem. @Robloche can you help me?

I'm sorry but I don't work on this project. I simply forked it to make fix a bug for my own use.
I suggest you do the same if you really need something to be done.

from chartjs-plugin-streaming.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.