Closed wylieconlon closed 4 years ago
Pinging @elastic/kibana-app (Team:KibanaApp)
@markov00 is this something you consider us fixing inside TSVB, or should this rather be addressed on elastic-charts level?
@timroes I think this should be done directly in TSVB as a default way label the series, is not an issue of charts, but the desired series name should be sent to elastic-charts from TSVB, we just render the configuration prodived.
There are multiple ways to change the series name in elastic-charts: https://elastic.github.io/elastic-charts/?path=/story/stylings--custom-series-name https://elastic.github.io/elastic-charts/?path=/story/stylings--custom-series-name-config https://elastic.github.io/elastic-charts/?path=/story/stylings--custom-series-name-formatting
I wonder if we would always want to show the metric name or only once we have at least 2 different metrics in there, so that it could actually lead to an ambigious legend. Marco or Wylie, any thoughts on that?
I'm doing this for vislib. I think we could just throw that logic in the charts
plugin and use it in tsvb. I can work on this after the vislib pr is merged.
@nickofthyme That sounds best, the existing logic in vislib is working well. @timroes to answer your question, the existing behavior of vislib works fine for me, which is to only add the extra text when it's needed.
@wylieconlon and @timroes I looked into this issue some more and I found that TSVB allows multiple "compounding" aggressions/metrics for a single layer (e.g. Count of Max AvgTicketPrice). Whereas in vislib you can only have one AFAIK. This makes it hard to put this aggression into a human readable string like Max AvgTicketPrice
to be used in a label such as ES Air: Max AvgTicketPrice
, as done in vislib.
But we currently allow the key
to be used in the layer title with a user defined value. Thus labeling the series with Series 1 - {{key}}
and Series 2 - {{key}}
produces something like this...
This way the series are discernible to the user without the need to determine the combined human readable aggregation.
I think if anything we could just combine the aggregations and use that when there is more than one layer but to me using the {{key}}
title seems like a much better option that is already in place.
@nickofthyme ++ on the {{key}}
approach. Will also prevent any breaking changes on charts in this case.
Ok cool. In that case, I'm gonna close this issue. Anyone feel free to re-open if you think it needs a better solution.
To be clear this code is here
Looks to be added here (https://github.com/elastic/kibana/pull/11266) in v5.5.0
.
TSVB should have the same legend behavior as Visualize when showing duplicate values across different series. Instead, it shows a legend which doesn't indicate the source of any value:
Example workflow:
Expected result, showing unique names for each series: