Code Monkey home page Code Monkey logo

Comments (6)

gor181 avatar gor181 commented on May 5, 2024 3

Hey @selimovicz ,

This should be solved in 1.5.1. Just get it from npm.
Usage:

<Bar
  data={data}
  width={100}
  height={50}
  getDatasetAtEvent={dataset => console.log(dataset)}
  options={{
    maintainAspectRatio: false
  }}
/>

Let me know how it goes.

Edit: And reopen the task if needed πŸ˜„

from react-chartjs-2.

jtmkrueger avatar jtmkrueger commented on May 5, 2024 2

This should really be in the documentation! If I put together a PR, can it get added?

from react-chartjs-2.

gor181 avatar gor181 commented on May 5, 2024 1

hey @selimovicz ,

Will try to implement it this week.

thanks for patience.

from react-chartjs-2.

selimovicz avatar selimovicz commented on May 5, 2024

@gor181 great, I appreciate that.

from react-chartjs-2.

selimovicz avatar selimovicz commented on May 5, 2024

Zdravo @gor181 , prvo hvala na brzom odgovoru :)

I found much more useful the following function: getElementAtEvent(), by using it I got single ChartElement with a bunch of object properties that are not my concern at the moment. But I couldn't find the way how to get X and Y value on that point, like it has been explained here: http://stackoverflow.com/questions/25514802/how-to-add-an-on-click-event-to-my-line-chart-using-chart-js.

from react-chartjs-2.

selimovicz avatar selimovicz commented on May 5, 2024

I found the answer here: http://stackoverflow.com/a/37123117/1452505.

Thanks anyway.
Hvala.

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.