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

Bug - Tooltips on Charts - Tooltips for non-Latin character code pages are too narrow #7923

Open
sjd78 opened this issue Sep 1, 2022 · 3 comments

Comments

@sjd78
Copy link
Member

sjd78 commented Sep 1, 2022

Describe the problem
By default the @patternfly/react-charts chart tooltips use the same text width estimation as is used in the Victory charts. This estimation works ok for ASCII characters, but underestimate sizes for other non-Latin character code pages.

How do you reproduce the problem?
Have a chart tooltip is any non-Latin character language. Japanese is a good example.

Expected behavior
The tooltips for Latin character languages have their text's width estimated well, but for non-Latin character language (such as Japanese), the text width is vastly underestimated.

Is this issue blocking you?
No, but could be very common in non-Latin languages. It was first detected in a Japanese translation.

The workaround used was to force the tooltip to a constant width wide enough to display the tooltip in every translation.

For example, in (https://github.com/oVirt/ovirt-engine-ui-extensions/blob/0642c73c45dc084bd841e1928884dd1fa61bb0b0/src/components/patternfly/DonutChart.js#L40-L52), the ChartTooltip's flyoutWidth is set to a constant value:

      <ChartDonutUtilization
        title={donutChartText}
        subTitle={donutChartSubtitle}
        themeColor={ChartThemeColor.green}
        labelComponent={<ChartTooltip flyoutWidth={180} />}
        data={{ x: 'Capacity', y: percentUsed * 100 }}
        labels={({ datum }) => datum.x ? usedLabel : availableLabel}
        thresholds={colors}
        events={[{ target: 'data', eventHandlers: { onClick: onDataClick } }]}
        height={200}
        width={200}
        padding={{ top: 15 }}
      />

Screenshots

Example 1:
screenshot-1

Example 2:
image-2022-03-24-20-50-57-694
What is your environment?

  • OS: Any
  • Browser: Any
  • Version: "@patternfly/react-charts": "^6.74.3"

What is your product and what release date are you targeting?
oVirt

Any other information?
See:

@tlabaj
Copy link
Contributor

tlabaj commented Sep 2, 2022

cc @dlabrecq

@mcoker mcoker removed their assignment Sep 2, 2022
sjd78 added a commit to sjd78/ovirt-web-ui that referenced this issue Sep 20, 2022
Followup PR [1] and add constant widths for all react-chart based
tooltips.  This is to work around patternfly-react issue [2] where
tooltips with non-Latin characters are rendered too narrow.

Bug-Url: https://issues.redhat.com/browse/RHV-45439

[1] - oVirt#1618
[2] - patternfly/patternfly-react#7923
sgratch pushed a commit to oVirt/ovirt-web-ui that referenced this issue Sep 28, 2022
Followup PR [1] and add constant widths for all react-chart based
tooltips.  This is to work around patternfly-react issue [2] where
tooltips with non-Latin characters are rendered too narrow.

Bug-Url: https://issues.redhat.com/browse/RHV-45439

[1] - #1618
[2] - patternfly/patternfly-react#7923
@stale
Copy link

stale bot commented Nov 1, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix label Nov 1, 2022
@dlabrecq
Copy link
Member

dlabrecq commented Nov 1, 2022

This is something that must be fixed upstream -- see https://github.com/FormidableLabs/victory/issues/2108

@stale stale bot removed the wontfix label Nov 1, 2022
@tlabaj tlabaj added pinned and removed needs info labels Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Not started
Development

No branches or pull requests

4 participants