-
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
Vislib: Percentage Bar Charts and Grouped Bar Charts #1659
Vislib: Percentage Bar Charts and Grouped Bar Charts #1659
Conversation
…a (bars). Also starting to log the error.stack instead of only the error.message in vis.js
Should provide the vislib side of #1618 |
Why not call these what they are?
Also, the "offset" parameter seems weird to me, is there a better name for that? View? Mode? Something better than either of those? |
@rashidkpc, there are several reasons.
I am fine with changing offset to something else. Disregard the above comments, we can easily change the options to the 3 you listed. |
Ok, so, now the options are:
For example: var params = {
type: 'vertical-bar',
mode: 'percentage'
};
var myVis = new Vis($el, params); |
…thrown when bar widths are less than 1px
stormpython@fee0c73 adds formatted percentage values to tooltips, as well as displays the actual value. See picture below. NOTE: This change should also work for area charts, pull request #1674. |
I am removing the discuss tag, since I've taken care of 2 of the major issues on my previous list in the initial pull request comment. I think this is ready for review. |
This seems ready to go... just need to rebase against master so we can cleanly merge it. |
var yScale = this.getYScale(height); | ||
var tickFormat = (self._attr.mode === 'percentage') ? | ||
d3.format('%') : d3.format('n'); |
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.
Single line here is fine
Conflicts: src/kibana/components/vislib/lib/data.js src/kibana/components/vislib/lib/y_axis.js src/kibana/components/vislib/visualizations/column_chart.js
Merged with master and made a correction in the y_axis.js file that @w33ble commented on. |
Conflicts: src/kibana/components/vislib/lib/data.js src/kibana/components/vislib/lib/y_axis.js
Vislib: Percentage Bar Charts and Grouped Bar Charts
Hi, in which version will this feature be present? I have CPU data from collectd that needs to be displayed as percentage and having the percentage being displayed when hovering over part of the bar would be great. I am running now Kibana4beta3 and when displaying max values, the percentage is not in the tooltip. |
@martinhynar It's coming in the next release which will be a release candidate. |
Adds the ability to create percentage bar charts and grouped bar charts. These changes work for both time series and nominal (d3 ordinal) scales. See photos below.
To use them, you'll need to specify an
offset
string in the parameters passed into theVis
constructor.There are 3 options available:
For example:
NOTE: There are still issues that need discussing before the pull request can be merged.
The first is regarding event data returned on by an event listener. Currently, it passes back the percentage value with the percentage bar charts, but in many cases, we will need both the percentage values and the original doc count, avg, min, max, etc.
The second issue is regarding buckets being cutoff on the left and right side of the charts, particularly on grouped bar charts. Some values in the group will appear while others will not.
Finally, there is the need for error handling with grouped bar charts on a time scale. Bars may become too thin to interact with.