Giter Site home page Giter Site logo

Comments (4)

jiayihu avatar jiayihu commented on May 7, 2024 4

@RamonBeast Inspecting chart_instance there is no .getCanvas() function but you can get it from chart_instance.chart.ctx

from react-chartjs-2.

gor181 avatar gor181 commented on May 7, 2024 1

Thanks @jiayihu, you are right.

image

@RamonBeast, please check as @jiayihu instructed.
You may also check the image I have just uploaded.

In case you have further questions feel free to reopen the issue.

from react-chartjs-2.

gor181 avatar gor181 commented on May 7, 2024

Hey @RamonBeast ,

Thanks for reporting.
It works as https://github.com/gor181/react-chartjs-2#chart-instance

So in your case it would be:

this.refs.linegraph.chart_instance

Please try and let me know.

Thank you,
Goran

from react-chartjs-2.

RamonBeast avatar RamonBeast commented on May 7, 2024

Thank you very much @gor181, I have no idea how I missed that in the home page :/.
I still can't access the canvas anyway. Shouldn't getCanvas() be accessible directly through the chart instance? Like this I:

this.refs.linegraph.chart_instance.getCanvas()

I keep getting:

TypeError: this.refs.linegraph.chart_instance.getCanvas is not a function

Thank you again for helping!

from react-chartjs-2.

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.