Skip to content

Add Negative Axes to Line, Bar, and Area Charts/Fix Pie Issues with 0 values - #2680

Merged
spalger merged 105 commits into
elastic:masterfrom
stormpython:fix/#1962
Feb 5, 2015
Merged

spalger merged 105 commits into
elastic:masterfrom
stormpython:fix/#1962

Conversation

@stormpython

Copy link
Copy Markdown
Contributor

Closes #1962.
Closes #2863.

This pull request adds the ability for negative data values in Kibana. Line, area, and bar charts can now display values in two directions, a negative and positive direction.

  1. Works for stacked and grouped bars in Vertical Bar charts.
  2. Works for stacked and overlap in Area Charts.
  3. Works using the extent of the data in line charts.

Fixes issues with pie chart when pies are returned with 0 values. If all values are zero, an error messaged is displayed which informs the user that no pie can be rendered due to the 0 values. Additionally, fixes the issue where no pie chart is rendered when any outer node is zero.

D3 builds pies from the outside in, and when the outer node is 0, it does not traverse the parent, it simply does not draw the relevant slices. So, values with zero needed to be filtered out so that pie slices could be rendered.

@rashidkpc

Copy link
Copy Markdown
Contributor

If all values on the chart are negative should the Y-axis start at 0? Seems like it?

screen shot 2015-01-19 at 10 11 21 am

@rashidkpc

Copy link
Copy Markdown
Contributor

Line chart doesn't see to work anymore:
screen shot 2015-01-19 at 10 18 02 am

@rashidkpc

Copy link
Copy Markdown
Contributor

Area charts, same issue as bar charts:
screen shot 2015-01-19 at 10 21 26 am

@rashidkpc

Copy link
Copy Markdown
Contributor

This also seems to kill event handlers on area charts

@stormpython

Copy link
Copy Markdown
Contributor Author

@rashidkpc I'll look into the event handling for area charts as well as that issue with line charts. As far as the y-axis defaulting to zero when all values are positive or negative. We plan on adding an option that allows users to choose to start the y-axis at zero or the min of the data set. We have also added an option for someone to set the min and max for the y-axis, although we need to get the UI in for it.

@stormpython

Copy link
Copy Markdown
Contributor Author

@rashidkpc the last commit fixed the issue with line charts, but I can't seem to recreate the event handler issues with area charts.

w33ble and others added 26 commits February 4, 2015 17:42
Conflicts:
	src/kibana/components/vislib/lib/data.js
	src/kibana/components/vislib/lib/handler/types/column.js
	src/kibana/components/vislib/lib/handler/types/line.js
Merged master and bucketOnExpression
Conflicts:
	src/kibana/components/vislib/lib/data.js
Working negative y-axes values
@stormpython stormpython changed the title Add Negative Axes to Line, Bar, and Area Charts Add Negative Axes to Line, Bar, and Area Charts/Fix Pie Issues with 0 values Feb 5, 2015
spalger pushed a commit that referenced this pull request Feb 5, 2015
Add Negative Axes to Line, Bar, and Area Charts/Fix Pie Issues with 0 values
@spalger
spalger merged commit 1d83784 into elastic:master Feb 5, 2015
@stormpython
stormpython deleted the fix/#1962 branch February 10, 2015 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pie chart treatment of 0 values - empty vis Negative Y-axis handling (bar/line/area)

5 participants