Is your feature request related to a problem? Please describe.
Have a way to format/truncate the axis labels without effecting the tooltip values.
Describe the solution you'd like
I think it would be too convoluted to have a tick formatter for legend, tooltip and axis. A better solution may be to have a third parameter to the tooltip function for where the value is used.
type Scope = 'tooltip' | 'legend' | 'axis';
export type TickFormatter = (value: any, options?: TickFormatterOptions, scope?: Scope) => string;
Then we can call this in any place differently without using three separate formatter functions. Similarly to how we currently handle naming.
|
/** |
|
* Function to create custom series name for a given series |
|
*/ |
|
export type SeriesNameFn = (series: XYChartSeriesIdentifier, isTooltip: boolean) => SeriesName; |
Describe alternatives you've considered
No real way to separate these cases as it currently stands.
Is your feature request related to a problem? Please describe.
Have a way to format/truncate the axis labels without effecting the tooltip values.
Describe the solution you'd like
I think it would be too convoluted to have a tick formatter for legend, tooltip and axis. A better solution may be to have a third parameter to the tooltip function for where the value is used.
Then we can call this in any place differently without using three separate formatter functions. Similarly to how we currently handle naming.
elastic-charts/src/chart_types/xy_chart/utils/specs.ts
Lines 88 to 91 in 2e26430
Describe alternatives you've considered
No real way to separate these cases as it currently stands.