Label Text Width Fit Feature Request
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- typescript
- Área
- data-visualization, frontend
Línea de trabajo
El issue no nombra archivos, tests ni puntos de entrada. Empieza localizando las rutas de renderizado de labels y rich text; después, define y valida una API de ajuste horizontal de texto para labels de ancho fijo en markPoint y componentes relacionados. El trabajo estará terminado cuando el comportamiento y la API estén documentados y cubiertos por tests.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What problem does this feature solve?
Currently, ECharts provides width and overflow properties (like truncate or break) for labels in markPoint, markLine, and other components. However, there is no native way to force text to fit a specific container width by stretching or narrowing the glyphs themselves (horizontal scaling).
In many UI designs—specifically when using markPoint with custom symbols like pins or boxes—we have a fixed-width area for text.
- Truncation (
truncate) hides important information. - Wrapping (
break) often breaks the visual layout or overflows the symbol vertically. - Font-size reduction is a common workaround, but it requires manual calculation of string lengths and doesn't guarantee a "flush" look on both sides.
I am looking for a feature similar to the SVG attribute textLength with lengthAdjust="spacingAndGlyphs" or the CSS text-stretch property. This would allow the text to horizontally scale to fill the exact width provided without changing the font height.
What does the proposed API look like?
I propose adding a property to the label or rich text styles, perhaps called fontStretch or an option within overflow.
Option A (New Property):
label: {
show: true,
width: 50,
// This would stretch or compress the text to be exactly 50px wide
fontStretch: 'fit'
}
**Option B (Enhancing Overflow):**
label: {
show: true,
width: 50,
overflow: 'fit' // A new option that scales the text width to match the defined width
}
- Lenguaje dominante
- TypeScript
- Estrellas
- 67.7k
- Forks
- 19.9k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la 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.
Más de apache/echarts
-
[Bug] String formatter templates only replace the first occurrence of `{a}`/`{b}`/`{c}`Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoen pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
-
[Bug] Inverse axis collapses the grid with outerBoundsContain when a tick is near the axis edgePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoen pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
en pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
en pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
[Bug] The zoom cursor in the toolbox area is incorrectPosiblemente ocupada @waterWang la tomó hace 98 días. Abiertobug en pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Todos los issues de apache/echarts
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
pollen-robotics/reachy-mini-desktop-app#341 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
mike-north/AgentMonitors#648 ·
Los mantenedores suelen responder en 1 día
-
Position: a popup placed again from between two layout steps lands a fraction of a pixel offAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
vercel-labs/ui#700 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 2 días