Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Histogram bar hover only works once #5930

Closed
spalger opened this issue Jan 18, 2016 · 6 comments
Closed

Histogram bar hover only works once #5930

spalger opened this issue Jan 18, 2016 · 6 comments
Assignees
Labels
bug Fixes for quality problems that affect the customer experience

Comments

@spalger
Copy link
Contributor

spalger commented Jan 18, 2016

2016-01-17 15_57_26


edit: Normally hovering over a bar causes the bar to fade out a little but. This seems to only work for the first bar each time a visualization is rendered. After re-rendering it will again work one time.

@spalger spalger added bug Fixes for quality problems that affect the customer experience P2 labels Jan 18, 2016
@rashidkpc
Copy link
Contributor

Am I missing something in this video?

@michaelcheng924
Copy link

@rashidkpc The hover color (lighter green) only shows for the first hover. After that the bars remain the normal green on hover.

Looks like the opacity is getting set directly on all of the rect elements when the mouse leaves, which overrides css/less styling. Don't know the app well enough to know where that's happening yet :).

@michaelcheng924
Copy link

Looks like the issue is here, with the data-label attribute:

    Dispatch.prototype.highlightLegend = function (element) {
      var label = this.getAttribute('data-label');
      if (!label) return;
      $('[data-label]', element.parentNode).not('[data-label="' + label + '"]').css('opacity', 0.5);
    };

    /**
     * Mouseout Behavior
     *
     * @param element {D3.Selection}
     * @method unHighlightLegend
     */
    Dispatch.prototype.unHighlightLegend = function (element) {
      $('[data-label]', element.parentNode).css('opacity', 1);
    };

The hover for the histogram behaves differently than for the Visualizations charts. I'll work on thinking of an appropriate solution, unless someone else wants to take this.

@michaelcheng924
Copy link

Turns out there's the same problem for vertical bar charts:

hovercolumns

UPDATE: It's because all the data-label names are Count when there is only one bucket. When a sub-bucket is added, the hovers work as expected.

@michaelcheng924
Copy link

Submitted a PR for this. Let me know if I'm missing anything.

@ppisljar
Copy link
Member

ppisljar commented Dec 9, 2016

fixed by #9044

when hovering over a bar chart (histogram, or over any other vislib chart for that matter) it will highlight bars with the same label. the bug was actually the first bar being highlighted ...it should not be as all bars are count. This was fixed to match vislib behaviour in the other charts

@ppisljar ppisljar closed this as completed Dec 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants