Coder Social home page Coder Social logo

On click on a slice of the pie table should show only the value of that slice, not the values for all the slices about leaflet-dvf HOT 2 OPEN

corinat avatar corinat commented on May 27, 2024
On click on a slice of the pie table should show only the value of that slice, not the values for all the slices

from leaflet-dvf.

Comments (2)

sfairgrieve avatar sfairgrieve commented on May 27, 2024

@corinat Apologies for the delay - I was on vacation. Currently, there's no out of the box way of doing this, but I don't think it would be too difficult to implement. One approach would be to extend L.PieChartMarker and override the _bindMouseEvents method with your own logic for handling interaction with each pie slice. _bindMouseEvents gets called for each slice of the pie chart marker. There you could handle mouse events like click. _bindMouseEvents currently handles the mouseover and mouseout events for displaying/removing the tooltip that shows the data value for each slice. The existing code should provide an example of how you might handle click events in a similar fashion. You may also be able to override bindPopup after extending L.PieChartMarker and figure out which slice was clicked - need to give that approach some more thought, but I think it might be doable.

from leaflet-dvf.

corinat avatar corinat commented on May 27, 2024

@sfairgrieve, thank you for the advice. Do you think that customizing the file that holds the data that are shown onlick could also work? It is a bit of work, but might a be a solution too, although your advice has more sense.

from leaflet-dvf.

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.