Skip to content

Adds capability to show percentages for data table columns - #39572

Merged
myasonik merged 6 commits into
elastic:masterfrom
myasonik:fix/percent-in-data-table
Jul 15, 2019
Merged

myasonik merged 6 commits into
elastic:masterfrom
myasonik:fix/percent-in-data-table

Conversation

@myasonik

@myasonik myasonik commented Jun 25, 2019 •

Copy link
Copy Markdown
Contributor

Summary

Add a configurable percentage column option to the table vis, closes #19489
Screen Shot 2019-07-08 at 17 15 37

Checklist

For maintainers

@myasonik myasonik added the WIP Work in progress label Jun 25, 2019
@myasonik
myasonik requested a review from markov00 June 25, 2019 12:33
@elasticmachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@myasonik
myasonik force-pushed the fix/percent-in-data-table branch from e69c166 to e0c99e1 Compare June 28, 2019 13:32
@myasonik myasonik self-assigned this Jun 28, 2019
@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

Comment thread src/legacy/core_plugins/table_vis/public/agg_table/agg_table.js Outdated
Comment thread src/legacy/core_plugins/table_vis/public/agg_table/agg_table.js Outdated
Comment thread src/legacy/core_plugins/table_vis/public/agg_table/agg_table.js Outdated
@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@markov00 markov00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code LGTM.
I've tested locally and I think there is one more thing to watch: when using a metric different from Count, and you add the percentage column, if than you change the aggregation field to a different one (using average agg for example on bytes first and then on machine.ram or another value) the column disappear but the editor keep showing the show percentage checkbox flagged and the dropdown selected. Removing the checkbox, applying, and reapplying the checkbox the column does not appear again. It will appear again only when changing the aggregation function.

Another small note: could you please move the checkbox just before the multiselect function?

Comment thread src/legacy/ui/public/vis/editors/default/agg.html Outdated
Comment thread test/functional/page_objects/visualize_page.js Outdated
@myasonik
myasonik force-pushed the fix/percent-in-data-table branch from 1d0aeea to 6758f6d Compare July 8, 2019 10:37
@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@myasonik
myasonik force-pushed the fix/percent-in-data-table branch from 6758f6d to 56e17ae Compare July 8, 2019 12:14
@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@myasonik myasonik removed the WIP Work in progress label Jul 8, 2019
@myasonik
myasonik marked this pull request as ready for review July 8, 2019 14:19
@myasonik myasonik changed the title [WIP] Adds capability to show percentages for data table columns Adds capability to show percentages for data table columns Jul 8, 2019
@myasonik
myasonik requested a review from markov00 July 8, 2019 14:24
@myasonik myasonik added Feature:Data Table Data table visualization feature release highlight Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v7.4.0 v8.0.0 labels Jul 8, 2019
@elasticmachine

Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-app

@markov00
markov00 requested review from AlonaNadler and timroes July 8, 2019 14:33

@markov00 markov00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is an issue when using this percentage function together with the show total function with something different than sum.
I think we should always display the percentage based on the sum of all the column values, not based on a different computed total.
I've also left some other minor commit/discussion points

Comment thread src/legacy/core_plugins/table_vis/public/agg_table/agg_table.js Outdated
Comment thread src/legacy/core_plugins/table_vis/public/agg_table/agg_table.js Outdated
Comment thread src/legacy/core_plugins/table_vis/public/agg_table/agg_table.js Outdated
Comment thread test/functional/apps/visualize/_data_table.js Outdated
Comment thread test/functional/apps/visualize/_data_table.js Outdated
Comment thread src/legacy/core_plugins/table_vis/public/table_vis_params.js
Comment thread src/legacy/core_plugins/table_vis/public/agg_table/__tests__/_table.js Outdated
@elasticmachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@myasonik
myasonik requested a review from markov00 July 10, 2019 16:28

@markov00 markov00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes LGTM. Tested locally.
There is just a minor issue but I think that should be addressed on a different PR on the aggconfig side:
Screenshot 2019-07-11 at 10 07 41
In this case the field still a numeric field but the format is different (string). @timroes shall we fix on some other level?

@timroes

timroes commented Jul 15, 2019

Copy link
Copy Markdown
Contributor

@markov00 I would tackle that in a separate PR.

@elasticmachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@myasonik
myasonik merged commit 8b6df17 into elastic:master Jul 15, 2019
myasonik pushed a commit to myasonik/kibana that referenced this pull request Jul 15, 2019
…9572)

* Bring table vis params styles inline with others

* Add percentage column option to table vis

* fixup! Add percentage column option to table vis

* fixup! Add percentage column option to table vis
@JZ-SmartThings

Copy link
Copy Markdown

@myasonik thank you so much for this! It works perfectly in 7.4.0 that got released today. The next step forward would be to add ability to show percentile for multiple columns. Don't want to sound ungrateful though, very nice implementation that's been sorely lacking from Kibana.

patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request May 6, 2026
…9572)

* Bring table vis params styles inline with others

* Add percentage column option to table vis

* fixup! Add percentage column option to table vis

* fixup! Add percentage column option to table vis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Data Table Data table visualization feature release_note:enhancement Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v7.4.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show percentage in data table

5 participants