Skip to content

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

@wylieconlon

Description

@wylieconlon

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: () => '',
    },
  }}
/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    :LensKibana Lens related issue:partitionPartition/PieChart/Donut/Sunburst/Treemap chart relatedenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions