Comments (4)
For hover events, you can use the plotly_hover
event. The DOM element for the graph will emit events, and you can bind event handlers like so:
var chart = document.getElementById('my-chart-element');
chart.on('plotly_hover', function(data){
// do something with the data
});
The data returned varies by event, but for plotly_hover
, you will have access to points
, xaxes
, yaxes
, and yvals
- all within the data
that is passed to your callback.
Here's an example with some tooltips.
from plotly.js.
Thanks for the info, @mdtusz . Do you know if this is documented somewhere? We couldn't find this anywhere in the docs.
from plotly.js.
Unfortunately, it's not very well documented at the moment, but we are working on it. This page and this page show some basic usage of hover and click events, but we will hopefully update the page with more detailed documentation and examples soon.
from plotly.js.
Updated documentation here: https://plot.ly/javascript/plotlyjs-events/
from plotly.js.
Related Issues (20)
- Pie chart not displaying when plotting big and small numbers at the same time. HOT 2
- how to download the plot in pdf format in chrome browser using plotly.js HOT 2
- The violin plot very weird HOT 1
- Feature: Country colour coding according to filter HOT 2
- Image Trace Not Displayed HOT 3
- The picture showing uncompletely and showing negative data plot HOT 4
- hoverlabel.grouptitlefont getting reset
- Scrollbar sensitivity in plot legend skips legend items
- Latex doesn't render in slider names or step labels.
- Browser Warning due to missing `willReadFrequently` on heatmap HOT 1
- `supply defaults by pass` bug caused by partial range
- Contour Graph does not include Boundary Values
- `stamen` map tiles changes in November 2023 HOT 1
- Bug: X-coordinates are duplicated in plotly_click points
- Changing x axis tick mark labels to a larger font fails to change the font size HOT 1
- changing Layout.xaxis.tickfont.size and Layout.yaxis.tickfont.size fails to work to make the axis tick labels a bigger font. HOT 4
- Overlap of rangeslider and legend
- Timestamp '1970/01/01 00:00:00' formats as 'undefined' in hovertext HOT 2
- Legend properties on shapes property of layouts is not being tracked by Typescript
- Allow `hovertemplate` to accept a closure HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plotly.js.