Skip to content

[Viz] legend duplicates percentile options when chart has both left & right Y axes#113073

Merged
DianaDerevyankina merged 5 commits intoelastic:masterfrom
DianaDerevyankina:issues/112388
Sep 27, 2021
Merged

[Viz] legend duplicates percentile options when chart has both left & right Y axes#113073
DianaDerevyankina merged 5 commits intoelastic:masterfrom
DianaDerevyankina:issues/112388

Conversation

@DianaDerevyankina
Copy link
Contributor

@DianaDerevyankina DianaDerevyankina commented Sep 24, 2021

Closes #112388
Partial changes from #111378

Summary

The reason for incorrect displaying of chart and its legend was ignoring the case for percentile column id. As it contains percent value after the point, we should take into account only id part before it, while filtering yAspects.

image

Checklist

For maintainers

@DianaDerevyankina DianaDerevyankina added Feature:XYAxis XY-Axis charts (bar, area, line) Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.16.0 labels Sep 24, 2021
@DianaDerevyankina DianaDerevyankina self-assigned this Sep 24, 2021
Copy link
Contributor

@Kuznietsov Kuznietsov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excepting the suggestion, the code LGTM. Tested locally, everything works as expected.

return m;
};

// For percentile aggregation id is coming in the form `%d.%d`, where first `%d` is `id` and the second - `percents`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: The mistake in this comment is my fault. I'd suggest changing %d.%d to %s.%d. The final comment would be:

  • // For percentile, the aggregation id is coming in the form %s.%d, where %s is agg_id and %d - percents.

@DianaDerevyankina DianaDerevyankina marked this pull request as ready for review September 27, 2021 08:20
@DianaDerevyankina DianaDerevyankina requested a review from a team as a code owner September 27, 2021 08:20
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-vis-editors (Team:VisEditors)

@DianaDerevyankina
Copy link
Contributor Author

@elasticmachine merge upstream

import { Aspect } from '../types';
import type { Aspect } from '../types';

interface Dimension {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This type here confuses me because we already have defined a type Dimension in the types folder. Is it different from this type? If yes, it should have a different name. If no, the already existing type should be used

@Kuznietsov Kuznietsov self-requested a review September 27, 2021 13:25
Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I tested it Chrome and works fine :D

Copy link
Contributor

@Kuznietsov Kuznietsov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM )

@DianaDerevyankina DianaDerevyankina merged commit 3e5d5f4 into elastic:master Sep 27, 2021
DianaDerevyankina added a commit to DianaDerevyankina/kibana that referenced this pull request Sep 27, 2021
… right Y axes (elastic#113073)

* [Viz] legend duplicates percentile options when chart has both left & right Y axes

* Update comment for isPercentileIdEqualToSeriesId

* Remove Dimension interface

* Replace partial aspect with whole aspect value

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
visTypeXy 62.5KB 62.4KB -72.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @dziyanadzeraviankina

DianaDerevyankina added a commit that referenced this pull request Sep 27, 2021
… right Y axes (#113073) (#113169)

* [Viz] legend duplicates percentile options when chart has both left & right Y axes

* Update comment for isPercentileIdEqualToSeriesId

* Remove Dimension interface

* Replace partial aspect with whole aspect value

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:XYAxis XY-Axis charts (bar, area, line) release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v7.16.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Viz] legend duplicates percentile options when chart has both left & right Y axes

6 participants