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

Expose normalizedNumberFormat for normalized % stack #8300

Closed
kanitw opened this issue Jul 18, 2022 · 3 comments
Closed

Expose normalizedNumberFormat for normalized % stack #8300

kanitw opened this issue Jul 18, 2022 · 3 comments
Assignees
Milestone

Comments

@kanitw
Copy link
Member

kanitw commented Jul 18, 2022

For normalized stacked charts (like bar), we automatically generate tooltips that calculates ratio / %.

image

However, we haven't applied any % formatting to this % tooltip yet.

We should

  1. Expose config.normalizedNumberFormat (or percentFormat or sth) for setting formatter for this % tooltip
  • Probably also add config.normalizedNumberFormatType so this config.normalizedNumberFormat has its own format type.
  1. Set the default config.normalizedNumberFormat (defaultConfig in config.ts) --- probably to.2%?

For testing, perhaps:

  1. modify stacked_bar_normalize.vl.json to include tooltip: true in mark to test the default format
    and
  2. add stacked_bar_normalize_custom_format.vl.json to test customized format in the config.
@kanitw kanitw added this to the 2022 Aug Polishes milestone Jul 18, 2022
@kanitw kanitw changed the title Expose percentFormat for normalized % stack Expose normalizeNumberFormat for normalized % stack Jul 19, 2022
@kanitw
Copy link
Member Author

kanitw commented Jul 19, 2022

cc: @domoritz @jheer @arvind

Any opinion for the config name?

At first I thought percentFormat/percentNumberFormat, but then the feature is only trigger via "normalize" stack and technically users don't really need to do % as the formatter, so config.normalizedNumberFormat might best match what the feature is for.

@domoritz
Copy link
Member

I like normalizedNumberFormat.

@kanitw kanitw changed the title Expose normalizeNumberFormat for normalized % stack Expose normalizedNumberFormat for normalized % stack Jul 21, 2022
@lsh
Copy link
Member

lsh commented Jul 23, 2022

Resolved by #8307

@lsh lsh closed this as completed Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants