feat(tooltip): allow postfix banded area series#391
feat(tooltip): allow postfix banded area series#391nickofthyme merged 6 commits intoelastic:masterfrom
Conversation
Allow user to set postfix for upper and lower bound of banded series to distinguish between values closes elastic#162
Codecov Report
@@ Coverage Diff @@
## master #391 +/- ##
==========================================
- Coverage 98.25% 98.05% -0.21%
==========================================
Files 38 39 +1
Lines 2814 2833 +19
Branches 666 673 +7
==========================================
+ Hits 2765 2778 +13
- Misses 44 50 +6
Partials 5 5
Continue to review full report at Codecov.
|
markov00
left a comment
There was a problem hiding this comment.
I've left a suggestion to consider before merging this.
I've tested this locally and works fine.
| * | ||
| * @default 'lower' | ||
| */ | ||
| y1AccessorPostfix?: string; |
There was a problem hiding this comment.
Hey @nickofthyme
can we change this to a postfix string OR a function that is invoked with the series name and return the user formatted series name like:
y0AccessorName={(seriesName) => { return `[min] ${seriesName}`; }}
because I think the position of the min/max fix depends on the user's language.
We can support both a string or a function?
In the case of the function, we can use it also on non-banded situations?
There was a problem hiding this comment.
Dangit! You're right, I should have thought of that.
| } | ||
|
|
||
| if (banded) { | ||
| if (y0Accessors && y0Accessors.length > 0) { |
There was a problem hiding this comment.
nit: small utility function?
as we are using this also on src/chart_types/xy_chart/store/utils.ts?
hasY0Accessors({y0Accessors}) {
return y0Accessors && y0Accessors.length > 0
}
|
🎉 This PR is included in version 13.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [13.3.0](elastic/elastic-charts@v13.2.0...v13.3.0) (2019-10-02) ### Features * **tooltip:** tooltip label format for upper/lower banded area series ([opensearch-project#391](elastic/elastic-charts#391)) ([701264c](elastic/elastic-charts@701264c)), closes [opensearch-project#162](elastic/elastic-charts#162)
Summary
Allow user to set postfix string or accessor for upper and lower bound of banded series to distinguish between values.
Adds
y1AccessorFormatandy0AccessorFormatprops toBasicSeriesSpec.y1AccessorFormatdefaults to' - upper'andy0AccessorFormatdefaults to' - lower'closes #162
see local storybook link http://localhost:9001/?path=/story/area-chart--band-area-chart
Area banded series
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.src/index.ts(and stories only import from../srcexcept for test data & storybook)