fix(last_value): compute last value for non stacked series#261
fix(last_value): compute last value for non stacked series#261markov00 merged 2 commits intoelastic:masterfrom
Conversation
The percentage stacked mode implies to use the formatted value to be shown in the tooltips and on the legend. I moved the computation from the splittes series to it's own function after the series set is formatted. The commit fix the current status where the last value was computed only for stacked series.
Codecov Report
@@ Coverage Diff @@
## master #261 +/- ##
==========================================
+ Coverage 97.84% 97.85% +<.01%
==========================================
Files 36 36
Lines 2693 2698 +5
Branches 607 609 +2
==========================================
+ Hits 2635 2640 +5
Misses 51 51
Partials 7 7
Continue to review full report at Codecov.
|
Are you referring to the legend showing 600 % and 200 % ? I will update the storybook for that, the wrong thing here is that I'm multipling by 100 the value on the |
Yes, the legend display value is what I was referring to. I wasn't exactly sure how we want to handle this since |
emmacunningham
left a comment
There was a problem hiding this comment.
besides the storybook issue, things working locally & code LGTM
nickofthyme
left a comment
There was a problem hiding this comment.
Tested locally, LGTM.
## [7.2.1](v7.2.0...v7.2.1) (2019-07-10) ### Bug Fixes * **last_value:** compute last value for non stacked series ([#261](#261)) ([803c34e](803c34e))
|
🎉 This PR is included in version 7.2.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [7.2.1](elastic/elastic-charts@v7.2.0...v7.2.1) (2019-07-10) ### Bug Fixes * **last_value:** compute last value for non stacked series ([opensearch-project#261](elastic/elastic-charts#261)) ([5bdaecd](elastic/elastic-charts@5bdaecd))

Summary
Fix an error introduced in #250 where the last value on the legend was undefined for non stacked series.
When using the stack percentage mode, the data values are computed on a percentage scale. As we want to display the percent value and not the original value when displaying a tooltip, I've changed the place where the lastValue value is captured: from the original dataset to the formatted one.
The commit fix the the fact that the last value was computed only for stacked series.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.[ ] Any consumer-facing exports were added tosrc/index.ts(and stories only import from../srcexcept for test data & storybook)[ ] This was checked for cross-browser compatibility, including a check against IE11[ ] Proper documentation or storybook story was added for features that require explanation or tutorials