Skip to content

[Lens] Add point visibility option for area/line charts#222187

Merged
andrimal merged 22 commits intoelastic:mainfrom
andrimal:feat/218770
Jun 10, 2025
Merged

[Lens] Add point visibility option for area/line charts#222187
andrimal merged 22 commits intoelastic:mainfrom
andrimal:feat/218770

Conversation

@andrimal
Copy link
Contributor

@andrimal andrimal commented Jun 2, 2025

Summary

Fix #218770

This PR implements a point visibility option into the Appearance configuration of line and area charts by using a Button group with 3 options - Auto, Show and Hide.

  • Auto: This should be the default option. It is based on the distance between the visible points. If the distance is too close (~40px), we are hiding the points, if it is larger then we visualize them.
  • Show: The points should always be visible.
  • Hide: The points should never be visible.

Area Chart:

Kapture 2025-06-03 at 15 55 50

Line Chart:

Kapture 2025-06-03 at 15 56 50

Chart with multiple layers:

Kapture 2025-06-03 at 15 52 34

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

@andrimal andrimal added release_note:enhancement Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// Feature:Lens backport:version Backport to applied version labels v8.19.0 labels Jun 4, 2025
@andrimal andrimal marked this pull request as ready for review June 4, 2025 13:41
@andrimal andrimal requested a review from a team as a code owner June 4, 2025 13:41
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@@ -141,6 +143,23 @@ export const VisualOptionsPopover: React.FC<VisualOptionsPopoverProps> = ({
<ToolbarDivider />
Copy link
Contributor

Choose a reason for hiding this comment

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

Given the specificity of both this and point visibility to Area and Line chart types I would probably avoid to render this divider (as the hasAreaSettings is a pre-requirement of isHasNonBarSeries to be true).
This first divider makes the popover look a bit too "packed":

Screenshot 2025-06-05 at 17 42 03
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I agree. Especially in the case of a chart with multiple layers (both bar + area/line) it was very packed. My initial concern was in the case where I have a chart with 2 layers of line and area, if it is clear that Point Visibility applies to both and not just the area chart because it is grouped with the fill opacity. But again I think it's a very simple/straight forward functionality.

After the change:

  • Line Chart:
Screenshot 2025-06-06 at 9 09 48 AM
  • Area Chart:
Screenshot 2025-06-06 at 9 07 59 AM
  • Multiple Layer Chart (Line+Area+Bar):
Screenshot 2025-06-06 at 9 09 19 AM
Copy link
Contributor Author

Choose a reason for hiding this comment

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

After further discussions, we decided to integrate the point visibility option with the rest of the line configs.

  • Line chart:
Screenshot 2025-06-06 at 2 14 46 PM
  • Area chart:
Screenshot 2025-06-06 at 2 14 57 PM
  • Bar + Line:
Screenshot 2025-06-06 at 2 13 14 PM
  • Bar + Area:
Screenshot 2025-06-06 at 2 17 17 PM
  • Bar + Line + Area:
Screenshot 2025-06-06 at 2 14 08 PM
@dej611 dej611 added the v9.1.0 label Jun 6, 2025
@andrimal
Copy link
Contributor Author

/ci

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
lens 1436 1437 +1

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
expressionXY 171 174 +3
lens 560 561 +1
total +4

Async chunks

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

id before after diff
expressionXY 99.8KB 99.9KB +159.0B
lens 1.5MB 1.5MB +1.4KB
total +1.5KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
expressionXY 40.0KB 40.3KB +344.0B
Unknown metric groups

API count

id before after diff
expressionXY 182 185 +3
lens 659 660 +1
total +4

History

@andrimal andrimal merged commit e314686 into elastic:main Jun 10, 2025
10 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15560942953

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jun 10, 2025
## Summary

Fix elastic#218770

This PR implements a point visibility option into the Appearance
configuration of line and area charts by using a Button group with 3
options - _Auto, Show_ and _Hide_.

- _Auto_: This should be the **default** option. It is based on the
distance between the visible points. If the distance is too close
(~40px), we are hiding the points, if it is larger then we visualize
them.
- _Show_: The points should always be visible.
- _Hide_: The points should never be visible.

### Area Chart:
![Kapture 2025-06-03 at 15 55
50](https://github.com/user-attachments/assets/d970be6b-a964-465c-af43-59e4a307e1d4)

### Line Chart:
![Kapture 2025-06-03 at 15 56
50](https://github.com/user-attachments/assets/d733b816-51f1-40ef-8bb9-6d4564be12e7)

### Chart with multiple layers:
![Kapture 2025-06-03 at 15 52
34](https://github.com/user-attachments/assets/46215372-73ce-49a9-bbd9-a1d047d16cf0)

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit e314686)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 10, 2025
…) (#223239)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Lens] Add point visibility option for area/line charts
(#222187)](#222187)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Andreana
Malama","email":"72010092+andrimal@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-06-10T13:31:58Z","message":"[Lens]
Add point visibility option for area/line charts (#222187)\n\n##
Summary\n\nFix #218770\n\nThis PR implements a point visibility option
into the Appearance\nconfiguration of line and area charts by using a
Button group with 3\noptions - _Auto, Show_ and _Hide_.\n\n- _Auto_:
This should be the **default** option. It is based on the\ndistance
between the visible points. If the distance is too close\n(~40px), we
are hiding the points, if it is larger then we visualize\nthem.\n-
_Show_: The points should always be visible.\n- _Hide_: The points
should never be visible.\n\n### Area Chart:\n![Kapture 2025-06-03 at 15
55\n50](https://github.com/user-attachments/assets/d970be6b-a964-465c-af43-59e4a307e1d4)\n\n###
Line Chart:\n![Kapture 2025-06-03 at 15
56\n50](https://github.com/user-attachments/assets/d733b816-51f1-40ef-8bb9-6d4564be12e7)\n\n###
Chart with multiple layers: \n![Kapture 2025-06-03 at 15
52\n34](https://github.com/user-attachments/assets/46215372-73ce-49a9-bbd9-a1d047d16cf0)\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e314686dba9fa25f91fba02849a8fe5f989fbe14","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:Visualizations","Feature:Lens","backport:version","v9.1.0","v8.19.0"],"title":"[Lens]
Add point visibility option for area/line
charts","number":222187,"url":"https://github.com/elastic/kibana/pull/222187","mergeCommit":{"message":"[Lens]
Add point visibility option for area/line charts (#222187)\n\n##
Summary\n\nFix #218770\n\nThis PR implements a point visibility option
into the Appearance\nconfiguration of line and area charts by using a
Button group with 3\noptions - _Auto, Show_ and _Hide_.\n\n- _Auto_:
This should be the **default** option. It is based on the\ndistance
between the visible points. If the distance is too close\n(~40px), we
are hiding the points, if it is larger then we visualize\nthem.\n-
_Show_: The points should always be visible.\n- _Hide_: The points
should never be visible.\n\n### Area Chart:\n![Kapture 2025-06-03 at 15
55\n50](https://github.com/user-attachments/assets/d970be6b-a964-465c-af43-59e4a307e1d4)\n\n###
Line Chart:\n![Kapture 2025-06-03 at 15
56\n50](https://github.com/user-attachments/assets/d733b816-51f1-40ef-8bb9-6d4564be12e7)\n\n###
Chart with multiple layers: \n![Kapture 2025-06-03 at 15
52\n34](https://github.com/user-attachments/assets/46215372-73ce-49a9-bbd9-a1d047d16cf0)\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e314686dba9fa25f91fba02849a8fe5f989fbe14"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/222187","number":222187,"mergeCommit":{"message":"[Lens]
Add point visibility option for area/line charts (#222187)\n\n##
Summary\n\nFix #218770\n\nThis PR implements a point visibility option
into the Appearance\nconfiguration of line and area charts by using a
Button group with 3\noptions - _Auto, Show_ and _Hide_.\n\n- _Auto_:
This should be the **default** option. It is based on the\ndistance
between the visible points. If the distance is too close\n(~40px), we
are hiding the points, if it is larger then we visualize\nthem.\n-
_Show_: The points should always be visible.\n- _Hide_: The points
should never be visible.\n\n### Area Chart:\n![Kapture 2025-06-03 at 15
55\n50](https://github.com/user-attachments/assets/d970be6b-a964-465c-af43-59e4a307e1d4)\n\n###
Line Chart:\n![Kapture 2025-06-03 at 15
56\n50](https://github.com/user-attachments/assets/d733b816-51f1-40ef-8bb9-6d4564be12e7)\n\n###
Chart with multiple layers: \n![Kapture 2025-06-03 at 15
52\n34](https://github.com/user-attachments/assets/46215372-73ce-49a9-bbd9-a1d047d16cf0)\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e314686dba9fa25f91fba02849a8fe5f989fbe14"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Andreana Malama <72010092+andrimal@users.noreply.github.com>
pmuellr pushed a commit to pmuellr/kibana that referenced this pull request Jun 11, 2025
## Summary

Fix elastic#218770

This PR implements a point visibility option into the Appearance
configuration of line and area charts by using a Button group with 3
options - _Auto, Show_ and _Hide_.

- _Auto_: This should be the **default** option. It is based on the
distance between the visible points. If the distance is too close
(~40px), we are hiding the points, if it is larger then we visualize
them.
- _Show_: The points should always be visible.
- _Hide_: The points should never be visible.

### Area Chart:
![Kapture 2025-06-03 at 15 55
50](https://github.com/user-attachments/assets/d970be6b-a964-465c-af43-59e4a307e1d4)

### Line Chart:
![Kapture 2025-06-03 at 15 56
50](https://github.com/user-attachments/assets/d733b816-51f1-40ef-8bb9-6d4564be12e7)

### Chart with multiple layers: 
![Kapture 2025-06-03 at 15 52
34](https://github.com/user-attachments/assets/46215372-73ce-49a9-bbd9-a1d047d16cf0)

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
nickpeihl pushed a commit to nickpeihl/kibana that referenced this pull request Jun 12, 2025
## Summary

Fix elastic#218770

This PR implements a point visibility option into the Appearance
configuration of line and area charts by using a Button group with 3
options - _Auto, Show_ and _Hide_.

- _Auto_: This should be the **default** option. It is based on the
distance between the visible points. If the distance is too close
(~40px), we are hiding the points, if it is larger then we visualize
them.
- _Show_: The points should always be visible.
- _Hide_: The points should never be visible.

### Area Chart:
![Kapture 2025-06-03 at 15 55
50](https://github.com/user-attachments/assets/d970be6b-a964-465c-af43-59e4a307e1d4)

### Line Chart:
![Kapture 2025-06-03 at 15 56
50](https://github.com/user-attachments/assets/d733b816-51f1-40ef-8bb9-6d4564be12e7)

### Chart with multiple layers: 
![Kapture 2025-06-03 at 15 52
34](https://github.com/user-attachments/assets/46215372-73ce-49a9-bbd9-a1d047d16cf0)

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
iblancof pushed a commit to iblancof/kibana that referenced this pull request Jun 16, 2025
## Summary

Fix elastic#218770

This PR implements a point visibility option into the Appearance
configuration of line and area charts by using a Button group with 3
options - _Auto, Show_ and _Hide_.

- _Auto_: This should be the **default** option. It is based on the
distance between the visible points. If the distance is too close
(~40px), we are hiding the points, if it is larger then we visualize
them.
- _Show_: The points should always be visible.
- _Hide_: The points should never be visible.

### Area Chart:
![Kapture 2025-06-03 at 15 55
50](https://github.com/user-attachments/assets/d970be6b-a964-465c-af43-59e4a307e1d4)

### Line Chart:
![Kapture 2025-06-03 at 15 56
50](https://github.com/user-attachments/assets/d733b816-51f1-40ef-8bb9-6d4564be12e7)

### Chart with multiple layers: 
![Kapture 2025-06-03 at 15 52
34](https://github.com/user-attachments/assets/46215372-73ce-49a9-bbd9-a1d047d16cf0)

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <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

backport:version Backport to applied version labels Feature:Lens release_note:enhancement Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.19.0 v9.1.0

4 participants