-
Notifications
You must be signed in to change notification settings - Fork 121
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
Legend should not show values from the chart #246
Comments
Looks like this is potentially also a way to avoid #163 |
The reason is exactly the one @emmacunningham wrote in slack: in a time series visualization is useful to see the last bucket value directly on the chart (legend in this case), instead of move your mouse to every single chart and aim the last data point to see its value. For sure there is a bit of duplication between the tooltip and the legend where, on hover, we are showing all the series values either on the legend and on the tooltip. This doesn’t happen if you are using a We for sure have to go through our defaults and configure them in a way to avoid as mush as possible code by consumers for sure (there is an issue to follow for that discussion: #121) I think @AlonaNadler can give us more insight for from a customer point of view. It will be great to have the rationale behind that behaviour in TSVB and it will also help us if we have any ER for that functionality |
I agree with Emma
@wylie in case users can hide the legend and get more space for the chart, do you still have this concern? |
I don't personally see the value in showing the last value, even in a time series. It feels redundant to what's already shown in two other ways- on the tooltip and by the axis values. It's also not useful for bars. So the ideal change for me is to completely remove this from the legend, and the second best option is to change the default so that this is not shown by default. |
I'm ok to disable the We will not remove completely that value from the legend, it's a requested feature. We can fix some use cases like when using non temporal data, but we can't remove it completely. I just want to show you the value of this
Let me try to give you some examples on those:
Same Grafana user also ask us to introduce more values on the legend like avg, min, max |
Absolutely, actually we are just trying to replicate the existing features of the libraries we have on Kibana, so in that case it's a main feature for TSVB.
We can find the required space if necessary, maybe it's worth having a meeting with the design team on that (we actually don't have any specific design decision on the legend)
We are going to add them, we have a style document that we are following to configure the default style of the charts https://docs.google.com/document/d/1bEK70zhXxM-t64H7rzohtUvo-fMmDy4qG0H7BD48lGo/edit #232
Yep, we also considered that, when we will start planning for accessibility we will consider display some part of the summary of specified by the user configurations.
That's another idea. There are few small problems here that needs to be solved: labels can overlaps and can happens most of the time for specific type metric charts, and labels moves up and down and you always have to visually link the line color to the color of the line to know what value you are looking at. So yes, there isn't a best practice, or there isn't a good way or a bad way to accomplish it. As first step we just reimplemented the current solution, we are absolutely open to add and include different solutions to that problem. |
@wylieconlon I think I've just found a more "robust" reason for that value on the legend: I'm completely with you about the fact that it's not intuitive at the first look and also redundant when comes to a single visualization, but can be useful when multiple visualization are displayed. |
For me, the problem I had with the value in the legend was not that it was there at all but that what the value was representing. I would have assumed that while not hovering on the chart, the legend values would be accumulative (or whatever the aggregation is) for the whole series across the x-axis. Basically, a total. I don't think it's clear at all that this number would indicate the last bucket in the series. Perhaps that's just a small change? |
@cchaos so for sure we have to disable that for ordinal x axis series because we don't have a linear ordering there, so the last bucket in that case doesn't mean nothing. |
Just make sure they're not styled the same, haha 😄 |
To add more ideas to this. I'm generally not a fan of this last value thing at all. But I noticed that if we have a split series and one of the series doesn't have a value for the "last" bucket, then the next-to-last value is checked and so on. Potentially resulting in the FIRST value if a given series only has a value in the first bucket. Resulting in a melting pot of first to last values thoroughly confusing the user. Notice in the gif below how Code Example
|
change the default value of `showLegendExtra` to `false` BREAKING CHANGE: Previously `showLegendExtra` was true by default always showing the legend extra value. Now it becomes always hidden by default close elastic#246
This commit will decouple the tooltip component from the XY chart to allow Partition and other chart type an ease use. BREAKING CHANGE: the `SeriesIdentifier` type is generalized into a simplified object with two values in common: `specId` and `key`. A specialized `XYChartSeriesIdentifier` extends now the base `SeriesIdentifier`. The `SettingsSpec` prop `showLegendDisplayValue` is renamed to `showLegendExtra` and its default value is now `false` hiding the current/last value on the legend by default. close #246
This commit will decouple the tooltip component from the XY chart to allow Partition and other chart type an ease use. BREAKING CHANGE: the `SeriesIdentifier` type is generalized into a simplified object with two values in common: `specId` and `key`. A specialized `XYChartSeriesIdentifier` extends now the base `SeriesIdentifier`. The `SettingsSpec` prop `showLegendDisplayValue` is renamed to `showLegendExtra` and its default value is now `false` hiding the current/last value on the legend by default. close #246
This commit will decouple the tooltip component from the XY chart to allow Partition and other chart type an ease use. BREAKING CHANGE: the `SeriesIdentifier` type is generalized into a simplified object with two values in common: `specId` and `key`. A specialized `XYChartSeriesIdentifier` extends now the base `SeriesIdentifier`. The `SettingsSpec` prop `showLegendDisplayValue` is renamed to `showLegendExtra` and its default value is now `false` hiding the current/last value on the legend by default. close #246
This commit moves the `Datum`, `Rotation`, `Position` and `Color` into `utils/commons`. It decouples the legend from axis position and moves the `scales` to `utils/scales`. It decouples the tooltip component from the XY chart to allow Partition charts and other chart to use it. close #246 Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
# [18.0.0](v17.1.1...v18.0.0) (2020-03-17) ### Code Refactoring * clean up TS types ([#554](#554)) ([22f7635](22f7635)), closes [#547](#547) [#547](#547) * decouple tooltip from XY chart ([#553](#553)) ([e70792e](e70792e)), closes [#246](#246) ### Features * cleaner color API on SeriesSpec ([#571](#571)) ([f769f7c](f769f7c)) * **legend:** allow color picker component render prop ([#545](#545)) ([90f4b95](90f4b95)) * **partition:** add element click, over and out events ([#578](#578)) ([103df02](103df02)) * **partition:** add tooltip ([#544](#544)) ([6bf9a69](6bf9a69)), closes [#246](#246) * percentage display in partitioning charts ([#558](#558)) ([d6aa8d7](d6aa8d7)) * specify series name with a function on SeriesSpec ([#539](#539)) ([358455a](358455a)) * xAccessor can be a function accessor ([#574](#574)) ([bcc3d63](bcc3d63)) ### BREAKING CHANGES * The `getSpecId`, `getGroupId`, `getAxisId` and `getAnnotationId` are no longer available. Use a simple `string` instead. * `customSeriesColors` prop on `SeriesSpec` is now `color`. The `CustomSeriesColors` type is replaced with `SeriesColorAccessor`. * Remove `customSubSeriesName` prop on series specs in favor of cleaner api using just the `name` prop on `SeriesSpec`. The types `SeriesStringPredicate`, `SubSeriesStringPredicate` have been removed. * the `SeriesIdentifier` type is generalized into a simplified object with two values in common: `specId` and `key`. A specialized `XYChartSeriesIdentifier` extends now the base `SeriesIdentifier`. The `SettingsSpec` prop `showLegendDisplayValue` is renamed to `showLegendExtra` and its default value is now `false` hiding the current/last value on the legend by default.
🎉 This issue has been resolved in version 18.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [18.0.0](elastic/elastic-charts@v17.1.1...v18.0.0) (2020-03-17) ### Code Refactoring * clean up TS types ([opensearch-project#554](elastic/elastic-charts#554)) ([6ce56fa](elastic/elastic-charts@6ce56fa)), closes [opensearch-project#547](elastic/elastic-charts#547) [opensearch-project#547](elastic/elastic-charts#547) * decouple tooltip from XY chart ([opensearch-project#553](elastic/elastic-charts#553)) ([cb02cd0](elastic/elastic-charts@cb02cd0)), closes [opensearch-project#246](elastic/elastic-charts#246) ### Features * cleaner color API on SeriesSpec ([opensearch-project#571](elastic/elastic-charts#571)) ([6a78c4e](elastic/elastic-charts@6a78c4e)) * **legend:** allow color picker component render prop ([opensearch-project#545](elastic/elastic-charts#545)) ([22ef1e6](elastic/elastic-charts@22ef1e6)) * **partition:** add element click, over and out events ([opensearch-project#578](elastic/elastic-charts#578)) ([4189573](elastic/elastic-charts@4189573)) * **partition:** add tooltip ([opensearch-project#544](elastic/elastic-charts#544)) ([0cffed4](elastic/elastic-charts@0cffed4)), closes [opensearch-project#246](elastic/elastic-charts#246) * percentage display in partitioning charts ([opensearch-project#558](elastic/elastic-charts#558)) ([993a448](elastic/elastic-charts@993a448)) * specify series name with a function on SeriesSpec ([opensearch-project#539](elastic/elastic-charts#539)) ([fc6430b](elastic/elastic-charts@fc6430b)) * xAccessor can be a function accessor ([opensearch-project#574](elastic/elastic-charts#574)) ([f702e2c](elastic/elastic-charts@f702e2c)) ### BREAKING CHANGES * The `getSpecId`, `getGroupId`, `getAxisId` and `getAnnotationId` are no longer available. Use a simple `string` instead. * `customSeriesColors` prop on `SeriesSpec` is now `color`. The `CustomSeriesColors` type is replaced with `SeriesColorAccessor`. * Remove `customSubSeriesName` prop on series specs in favor of cleaner api using just the `name` prop on `SeriesSpec`. The types `SeriesStringPredicate`, `SubSeriesStringPredicate` have been removed. * the `SeriesIdentifier` type is generalized into a simplified object with two values in common: `specId` and `key`. A specialized `XYChartSeriesIdentifier` extends now the base `SeriesIdentifier`. The `SettingsSpec` prop `showLegendDisplayValue` is renamed to `showLegendExtra` and its default value is now `false` hiding the current/last value on the legend by default.
Describe the bug
The legend shows either the right-most value from the chart or the currently-hovered series. It would make more sense to hide the value, giving more space for the legend or chart.
To Reproduce
This behavior is shown in all of the chart samples, including: https://elastic.github.io/elastic-charts/?selectedKind=Bar%20Chart&selectedStory=with%20axis%20and%20legend&full=0&addons=1&stories=1&panelRight=1&addonPanel=storybook%2Fstories%2Fstories-panel
Expected behavior
Because there is already the same information available elsewhere, I would expect the numeric value to be hidden on the legend.
Checklist
[ ] every related Kibana issue is listed underKibana Cross Issues
list[ ]kibana cross issue
tag is associated to the issue if any kibana cross issue is presentThe text was updated successfully, but these errors were encountered: