Individual tooltip formatters within a series #241
Labels
enhancement
New feature or request
:tooltip
Related to hover tooltip
:xy
Bar/Line/Area chart related
Is your feature request related to a problem? Please describe.
As a series can have multiple y accessors, it can contain multiple data points for the same x accessor value. To format the tooltips, currently the tick formatter of the axis is used. There are situations in which it would make sense to have different formatters for the tooltip values of the individual series (e.g. because in Kibana formatters can be attached to a field which could result in two y values on the same axis with two different formatters)
Describe the solution you'd like
Not 100% sure about the api, but there could be a prop on the series to configure the tooltip formatters in greater detail:
If a user wants to specify just one formatter for the tooltip values which differentiates from the tick formatter, something like this could also be provided:
The specifity priority should probably be default formatter -> axis tick formatter -> single series tooltip formatter -> y-accessor specific tooltip formatter.
Describe alternatives you've considered
A current workaround is to have a separate hidden axis for each series, but to do so you have to harmonize the domains of each axis by basically doing what elastic-charts is doing internally:
-if you have all negative values and
yScaleToExtent=false
than the min domain is 0 and the max domain is the max negative value-if you have all negative values and
yScaleToExtent=true
than the min domain is the min negative and the max domain is the max negative valueAdditional context
Kibana Cross Issues
Checklist
Kibana Cross Issues
listkibana cross issue
tag is associated to the issue if any kibana cross issue is presentThe text was updated successfully, but these errors were encountered: