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

Mixing bars with line or area series breaks legend toggle #399

Closed
nickofthyme opened this issue Sep 30, 2019 · 3 comments · Fixed by #410
Closed

Mixing bars with line or area series breaks legend toggle #399

nickofthyme opened this issue Sep 30, 2019 · 3 comments · Fixed by #410
Assignees
Labels
bug Something isn't working :chart Chart element related issue :legend Legend related issue released Issue released publicly

Comments

@nickofthyme
Copy link
Collaborator

nickofthyme commented Sep 30, 2019

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://elastic.github.io/elastic-charts/?path=/story/mixed-charts--bar-and-lines or https://elastic.github.io/elastic-charts/?path=/story/mixed-charts--areas-and-bars
  2. Click to toggle the bars series in the legend.
  3. Notice the line/area series is no longer visible.

Expected behavior
The line and area charts do not hide when bar series is toggled.

Screenshots

Bars with line

Screen Recording 2019-09-30 at 10 31 AM

Bars with area

Screen Recording 2019-09-30 at 10 31 AM

Also remove the 0 in upper left corner

Image 2019-09-30 at 11 23 50 AM

Version (please complete the following information):

  • OS: all
  • Browser: chrome/all
  • Elastic Charts: master

Additional context
The hover state works fine so must be something related to the deselectedDataSeries or toggleSingleSeries method in chart_state.ts

@nickofthyme nickofthyme added bug Something isn't working :chart Chart element related issue :legend Legend related issue labels Sep 30, 2019
@rshen91 rshen91 self-assigned this Oct 7, 2019
@rshen91
Copy link
Contributor

rshen91 commented Oct 7, 2019

Notes to self:
This might be a Konva bug on initial investigation:
console.logging before this.deselectedDataSeries = updateDeselectedDataSeries(this.deselectedDataSeries, legendItem.value); in chart_state.ts shows null for deselecting bars in the legend but shows [] for deselecting line or area based on the story 🤔
The errors in the console point to Konva warnings about "points" attribute has non numeric element NaN...checking out where Konva comes in and seeing if the null is not being cast whereas the [] can be cast to a number 🤔

Screen Shot 2019-10-07 at 12 06 49 PM

@rshen91
Copy link
Contributor

rshen91 commented Oct 8, 2019

export function buildLineRenderProps in rendering_props_utils.ts takes in 'x' as a parameter and adding before the return statement the following below resolves the Konva Infinity warning:

if (x === Infinity) {
    x = 53.53125;
}

I took the 53.53125 from the lines value but I'm not sure if this value would make sense for all cases beyond the mixed stories.

markov00 pushed a commit that referenced this issue Oct 9, 2019
## [13.5.1](v13.5.0...v13.5.1) (2019-10-09)

### Bug Fixes

* mixing bars with line or area series breaks legend toggle ([#410](#410)) ([57c0e3c](57c0e3c)), closes [#399](#399)
@markov00
Copy link
Member

markov00 commented Oct 9, 2019

🎉 This issue has been resolved in version 13.5.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Oct 9, 2019
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this issue Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working :chart Chart element related issue :legend Legend related issue released Issue released publicly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants