Skip to content
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

tickFormatter for legend, tooltip and axis #713

Closed
nickofthyme opened this issue Jun 16, 2020 · 1 comment · Fixed by #750
Closed

tickFormatter for legend, tooltip and axis #713

nickofthyme opened this issue Jun 16, 2020 · 1 comment · Fixed by #750
Labels
enhancement New feature or request released Issue released publicly

Comments

@nickofthyme
Copy link
Collaborator

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.

@nickofthyme nickofthyme added the enhancement New feature or request label Jun 16, 2020
@nickofthyme nickofthyme added this to Backlog in Vislib replacement via automation Jun 16, 2020
@nickofthyme nickofthyme moved this from Backlog to June plan in Vislib replacement Jun 16, 2020
Vislib replacement automation moved this from July plan to Done Jul 15, 2020
@markov00
Copy link
Member

🎉 This issue has been resolved in version 19.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released Issue released publicly
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants