-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Show values of bars inside bar charts #36511
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5b1323c
add labels to bar chart
mmeshi 29dac34
code simplification
mmeshi 8b6a347
clean trailing spaces
mmeshi 27e23b5
for stack mode label color will be w/b
mmeshi b480bef
change label message on option panel, and show the option only for hi…
mmeshi affce12
better way to manipulate axis to make room for labels
mmeshi a0206c5
fixes for user defined axis, and negative value
mmeshi 6eccff5
fix label position in grouped vertical mode
mmeshi 3d18610
refactor label color style to css classes
mmeshi c076009
cosmetic changes in label classes
mmeshi 3260ca1
Merge branch 'master' of github.com:elastic/kibana into barChartLabels
markov00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@import './variables'; | ||
|
||
@import './lib/index'; | ||
|
||
@import './visualizations/point_series/index'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/legacy/ui/public/vislib/visualizations/point_series/_index.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import './labels'; |
20 changes: 20 additions & 0 deletions
20
src/legacy/ui/public/vislib/visualizations/point_series/_labels.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
$visColumnChartBarLabelDarkColor: #000; // EUI doesn't yet have a variable for fully black in all themes; | ||
$visColumnChartBarLabelLightColor: $euiColorGhost; | ||
|
||
.visColumnChart__barLabel { | ||
font-size: 8pt; | ||
pointer-events: none; | ||
} | ||
|
||
.visColumnChart__barLabel--stack { | ||
dominant-baseline: central; | ||
text-anchor: middle; | ||
} | ||
|
||
.visColumnChart__bar-label--dark { | ||
fill: $visColumnChartBarLabelDarkColor; | ||
} | ||
|
||
.visColumnChart__bar-label--light { | ||
fill: $visColumnChartBarLabelLightColor; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specially with small bars or with bigger values, there is the issue that only lower bars or lower values are displayed. like in this screenshot
![Screenshot 2019-06-18 at 12 14 36](https://user-images.githubusercontent.com/1421091/59674562-d33ab100-91c3-11e9-9f98-d92a1d5a8e48.png)
What do you think if we can add a configurable parameter that force the display of all the labels, also if they are bigger than the bar width?
As for the stacked case, just be aware of the color of the text for non stacked bars because the text can overlap with a bar with the same color.
Maybe we can just use the black/white color also for non stacked bars
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid that if we allow to label to spread out, it may become a mess. Even, with a configuration (which is a user responsiblity), still at configuration time, it may remained nice, but later with specific set of data, the graph become ugly.