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

Pie charts should have a setting for hiding numbers from chart, but keeping in tooltip #634

Open
wylieconlon opened this issue Apr 16, 2020 · 1 comment
Labels
enhancement New feature or request :Lens Kibana Lens related issue :partition Partition/PieChart/Donut/Sunburst/Treemap chart related

Comments

@wylieconlon
Copy link

The goal of this request is to have a combination of settings for pie charts that can do the following.

  • In fillLabels, I want no numbers
  • In linkLabels, I want no numbers
  • In tooltips, I want to show formatted value and percent

The closest we can get today is by setting <Partition valueFormatter={() => ''} />, which does not solve the tooltip issue

Screenshot 2020-04-16 11 37 08

In that example, only the percent is shown in the tooltip:

Screenshot 2020-04-16 11 39 49

I would like to have the tooltip show both the numeric value and percentage, which happens in the default case:

Screenshot 2020-04-16 11 40 19

The specific API I would request to do this already exists, but is missing. I would expect the following to work:

<Partition
  valueAccessor={(d: Datum) => d.exportVal as number}
  valueFormatter={(d: number) => `$${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\xa0Bn`}
  config={{
    fillLabel: {
      valueFormatter: () => '',
    },
    linkLabel: {
      valueFormatter: () => '',
    },
  }}
/>
@wylieconlon wylieconlon added enhancement New feature or request :partition Partition/PieChart/Donut/Sunburst/Treemap chart related :Lens Kibana Lens related issue labels Apr 16, 2020
@wylieconlon
Copy link
Author

I think that the closest configuration I've found is:

    fillLabel: {
      valueFormatter: () => '',
    },

This does everything except hide the percent value from the linked label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request :Lens Kibana Lens related issue :partition Partition/PieChart/Donut/Sunburst/Treemap chart related
Projects
None yet
Development

No branches or pull requests

1 participant