patternfly / patternfly/patternfly-react
Bug - Tooltips on Charts - Tooltips for non-Latin character code pages are too narrow
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 862
- Forks
- 392
- Merge medio
- 4 d 8 h
- PR fusionados (30 d)
- 9
Descripción
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:

Example 2:

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:
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con el punto de entrada ChartTooltip de @patternfly/react-charts e inspecciona cómo se estima el ancho del texto del flyout a partir del comportamiento de los gráficos de Victory. Reproduce el problema con una traducción al japonés o a otro idioma no latino, usando como comparación el workaround flyoutWidth indicado. Se considera terminado cuando el ancho del texto del tooltip ya no se subestima considerablemente para los idiomas no latinos.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- react, typescript
- Área
- frontend, internationalization
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 38/100