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.

Disable bar chart darken on hover

See original GitHub issue

Question: is it possible to disable the bar chart darkening on hover? I actually want the opposite effect, where the bar that’s being hovered over stays the same but the other bars get darker, which I can do with a custom mouseover event. But it seems like the darkening will always happen because it comes after (in the source code):

function handleMouseOver(e, d, chartWidth, chartHeight) {
    dispatcher.call('customMouseOver', e, d, d3Selection.mouse(e), [chartWidth, chartHeight]);
    d3Selection.select(e).attr('fill', ({name}) => d3Color.color(colorMap(name)).darker());
}

EDIT: I’ve come up with a workaround that mostly works. On the first hover, all bars darken (haven’t figured out why), but on subsequent hovers, it has the effect that I want. https://codepen.io/chinaowl/pen/jYejrd

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
dalerasrorov-ebcommented, Feb 2, 2018

@chinaowl this weekend or next Monday!

0reactions
dalerasrorov-ebcommented, Feb 4, 2018

Closing this @chinaowl, the functionality was released in 2.5.0 and the new functionality to apply a custom behavior to highlighted bars is ready https://github.com/eventbrite/britecharts/pull/503 and will be released later. Thanks for opening the issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Color Chart Background onHover in Chart JS - YouTube
However, we want to make sure the trigger will only on hover. ... With chart js you can make line chart, bar chart,...
Read more >
How to disable CSS:hover ( reset ) dropdown after a ... - Reddit
The only way to do this is with JavaScript, remove or add a class that resets it with css on click.
Read more >
Background color for negatives and columns dim on hover
Hello All, chart in the first screen needs to remove the gray background. In the second screen, columns become dimmer when I hover...
Read more >
Bar chart | nivo
Also supports both vertical and horizontal layout, with negative values descending below the x axis (or y axis if using horizontal layout). The...
Read more >
Formatting the Mouse Over Indicator (mouseOverIndicator)
For other chart types (such as bar, area, pie, tagcloud, treemap, ... This is the default value. false, which disables the mouse over...
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