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.

(select) events on charts should return key event data

See original GitHub issue

I’m submitting a … (check one with “x”)

  • bug report - search github for a similar issue or PR before submitting
  • feature request
  • support request - use StackOverflow (add the ngx-charts tag) or the gitter chat for support questions

Current behavior

(select) events include only name and value, not key events. That makes me do more work to determine if the control or shift key is down. Expected behavior

I would like to be able to test if the control or shift key is down. The event that is returned should have more information than just name and value. Reproduction of the problem

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • ngx-charts version: x.x.x

10.0.0

  • Angular version: x.x.x
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: [all | TypeScript X.X | ES6/7 | ES5]

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
lanierhallcommented, Sep 25, 2019

In fact, not only should it return more click data (mouse info, plus ctrl-key and shift-key status) but it should also return user data attached to the element. The name and value may not be unique among the data points. Compare how JavaFX lets the user set userData on a node.

There is an ‘extra’ field for holding and returning any data you need on a select event. See: https://github.com/swimlane/ngx-charts/issues/1269

1reaction
DonaldAlancommented, Feb 11, 2019

In fact, not only should it return more click data (mouse info, plus ctrl-key and shift-key status) but it should also return user data attached to the element. The name and value may not be unique among the data points. Compare how JavaFX lets the user set userData on a node.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling Events | Charts - Google Developers
There is one event that any selectable chart should fire: the select event. ... which returns an array of objects describing the selected...
Read more >
Click events on Pie Charts in Chart.js - Stack Overflow
Looks for the element under the event point, then returns all elements at the same data index. This is used internally for 'label'...
Read more >
chart.events.selection | highcharts API Reference
Through event.options you can access the series options that were passed to the addSeries method. Returning false prevents the series from being added....
Read more >
Chart Events in Microsoft Excel - Peltier Tech
These event procedures can trap events in the worksheet, ... When you select an element in Chart A, you'll return to the main...
Read more >
Interactions - Chart.js
Converting Events to Data Values. A common occurrence is taking an event, such as a click, and finding the data coordinates on the...
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