question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add chart double click event, and perhaps default it to "Home"

See original GitHub issue

Is your feature request related to a problem? Please describe.

No problem.

Describe the solution you’d like

I would love to have an easier access to the “Home” (reset zoom) feature, that does not require the toolbar to be visible. Many charting libraries I have used, use either the double click event for it, or some use the “mouse drag from right to left” to do it (as opposed to dragging from left to right to left to zoom).

I was looking at the events section, and noticed there is no such event. So, even if the collaborators of this repository do not agree to implementing a “double click to zoom out”, perhaps expose a double click event for us?

So we could do:

chart: {
  toolbar: {
    autoSelected: 'zoom'
  },
  events: {
    doubleClick: function(event, chartContext, config) {
      chart.resetSeries();
    }
  }
},

Describe alternatives you’ve considered

I have tried using the click event for it, but it will not work, since it immediately triggered after zooming.

Additional context

None.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
illoincommented, Apr 6, 2022

@DannyBen , you can use this code

events: {
  click: function(event, chartContext, config) {
    if (event.detail === 2) chart.resetSeries();
  }
}

Reset zoom by double click code example on CodePen.io

0reactions
DannyBencommented, Apr 7, 2022

thanks @illoin - seems like a reasonable solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Double Click Event on charts in a worksheet - Stack Overflow
To make the double click do anything, you need to use Chart Events. You can read my tutorial about Chart Events in Microsoft...
Read more >
How to use Double Click in Chart js - YouTube
How to use Double Click in Chart jsIn this video we will cover how to use double click in chart js. The double...
Read more >
Chart Events in Microsoft Excel - Peltier Tech
Press the F11 function key, to quickly create a chart sheet from the data range range, using the default chart type. Chart Sheet....
Read more >
How to run function on (double) click event in bar graph
Figures out wher eyou clicked using (maybe the vertex property of the bar graph (patch object) etc) and does some zooming. Hopefully this...
Read more >
How to double click chart title and series title to edit them in ...
adding TextBox at the place of ChartTitle and make it focus on double click as per below code snippet and also add your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found