Skip to content
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

The chart do not render negative values #135

Closed
2 tasks
sulemanof opened this issue Apr 1, 2019 · 4 comments · Fixed by #149
Closed
2 tasks

The chart do not render negative values #135

sulemanof opened this issue Apr 1, 2019 · 4 comments · Fixed by #149
Assignees
Labels
bug Something isn't working released Issue released publicly

Comments

@sulemanof
Copy link

Describe the bug
The chart do not render negative values (y-axis). But the tooltip still show these values.

To check this behavior in TSVB you could use bucket_script option:
image

The tooltip still renders negative values:
negative_values

Here is the series data:

[[1554066000000,-2],[1554066600000,-1],[1554067200000,null],[1554067800000,-1],[1554068400000,-1],[1554069000000,-1],[1554069600000,-2],[1554070200000,-2],[1554070800000,-4],[1554071400000,-3],[1554072000000,null],[1554072600000,-3],[1554073200000,-3],[1554073800000,-2],[1554074400000,-7],[1554075000000,-5],[1554075600000,-6],[1554076200000,-6],[1554076800000,-5],[1554077400000,-7],[1554078000000,-4],[1554078600000,-8],[1554079200000,-10],[1554079800000,-5],[1554080400000,-10],[1554081000000,-6],[1554081600000,-10],[1554082200000,-6],[1554082800000,null],[1554083400000,-10],[1554084000000,-14],[1554084600000,-14],[1554085200000,-17],[1554085800000,-12],[1554086400000,-21],[1554087000000,-20],[1554087600000,-18],[1554088200000,-29],[1554088800000,-25],[1554089400000,-25],[1554090000000,-35],[1554090600000,-37],[1554091200000,-25],[1554091800000,-32],[1554092400000,-37],[1554093000000,-43],[1554093600000,-48],[1554094200000,-51],[1554094800000,-38],[1554095400000,-50],[1554096000000,-56],[1554096600000,-60],[1554097200000,-54],[1554097800000,-51],[1554098400000,-71],[1554099000000,-62],[1554099600000,-73],[1554100200000,-73],[1554100800000,-62],[1554101400000,-69],[1554102000000,-75],[1554102600000,-67],[1554103200000,-78],[1554103800000,-70],[1554104400000,-77],[1554105000000,-94],[1554105600000,-86],[1554106200000,-80],[1554106800000,-82],[1554107400000,-97],[1554108000000,-91],[1554108600000,-86],[1554109200000,-83],[1554109800000,-76],[1554110400000,-105],[1554111000000,-80],[1554111600000,-77],[1554112200000,-87],[1554112800000,-81],[1554113400000,-86],[1554114000000,-90],[1554114600000,-75],[1554115200000,-69],[1554115800000,-55],[1554116400000,-71],[1554117000000,-57],[1554117600000,-65],[1554118200000,-71],[1554118800000,-86],[1554119400000,-70],[1554120000000,-66],[1554120600000,-65],[1554121200000,-52],[1554121800000,-55],[1554122400000,-60],[1554123000000,-45],[1554123600000,-53],[1554124200000,-37],[1554124800000,-42],[1554125400000,-35],[1554126000000,-39],[1554126600000,-40],[1554127200000,-43],[1554127800000,-30],[1554128400000,-15],[1554129000000,-19],[1554129600000,-28],[1554130200000,-21],[1554130800000,-17],[1554131400000,-15],[1554132000000,-18],[1554132600000,-15],[1554133200000,-14],[1554133800000,-10],[1554134400000,-9],[1554135000000,null],[1554135600000,-4],[1554136200000,-10],[1554136800000,-12],[1554137400000,-12],[1554138000000,-8],[1554138600000,-12],[1554139200000,-6],[1554139800000,-3],[1554140400000,-9],[1554141000000,-5],[1554141600000,-2],[1554142200000,-6],[1554142800000,-3],[1554143400000,-1],[1554144000000,-1],[1554144600000,-1],[1554145200000,null],[1554145800000,null],[1554146400000,-2],[1554147000000,-2],[1554147600000,null],[1554148200000,-1],[1554148800000,-1],[1554149400000,null],[1554150000000,null],[1554150600000,-2],[1554151200000,null]]

To Reproduce
Steps to reproduce the behavior:

  1. Create a chart with negative y-axis values
  2. The chart do not render them
  3. Hover on a chart -> tooltip shows negative values

Expected behavior
The chart should be rendered properly

Version (please complete the following information):

  • OS: Windows 10
  • Browser Chrome 73
  • Elastic Charts: 3.4.4

Kibana Cross Issues
Add any Kibana related issues here.

Checklist

  • every related Kibana issue is listed under Kibana Cross Issues list
  • kibana cross issue tag is associated to the issue if any kibana cross issue is present
@sulemanof sulemanof added the bug Something isn't working label Apr 1, 2019
@markov00 markov00 mentioned this issue Apr 1, 2019
93 tasks
@markov00 markov00 added this to the 7.1 milestone Apr 1, 2019
@emmacunningham emmacunningham self-assigned this Apr 3, 2019
@emmacunningham
Copy link
Contributor

@sulemanof if you set yScaleToDataExtent={true} on the series, the negative values should render.

@markov00 currently computeContinuousDomain assumes a positive scale, so if scaleToExtent is false, then the start of the domain is assumed to be 0, even if we only have negative values. when both the computed start and end of a range are negative, seems like we would want scaleToExtent to affect it differently (if true, set the range to [start, end]; if false [start, 0] instead of [0, end] as it is currently).

@markov00
Copy link
Member

markov00 commented Apr 4, 2019

@emmacunningham you are right, we should check the following situations:

min max scaleToExtent domain domain example
pos pos false [0, max] [0, 100]
neg neg false [min, 0] [-100,0]
neg pos false force to [min, max] ? [-100,100]
pos pos true [min, max] [10, 100]
neg neg true [max, min] [-100, -10]
neg pos true force to [min, max] ? [-100, 100]

what about ignoring the scaleToExtent in the case of a negative and positive as the extent value?

@emmacunningham
Copy link
Contributor

@markov00 yes, it makes sense to ignore scaleToExtent when we have negative & positive extent value. This is perhaps something that we could also surface as a warning (#85) so the user can known why their setting is being ignored?

@markov00
Copy link
Member

markov00 commented Apr 5, 2019

🎉 This issue has been resolved in version 3.7.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released Issue released publicly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants