Axis tick stubs: no style option, and `ticks: false` also hides the tick labels
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 54/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- data-visualization
Línea de trabajo
Start by reading the axis rendering and tick-count logic in dist/scene.js at the locations cited in the issue, then inspect ChartAxisTickOptions. Compare the two minimal repros with the expected behavior; the issue leaves open whether stubs should inherit the axis line style or get their own option. Done when stub styling and the effect of ticks: false versus { size: 0 } are resolved and documented clearly.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version: @tanstack/charts 1.0.0
Problem
(a) Tick stubs ignore the axis line style and have no style of their own
https://github.com/TanStack/charts/pull/148 added ChartGuideLineStyle (stroke, strokeOpacity, strokeWidth, strokeDasharray, lineCap) for grid and the axis line. The tick stubs do not get it.
In dist/scene.js the axis line uses axisStyle(presentation?.line) (lines 933 and 1017), but each tick stub uses axisStyle() with no argument (lines 973 and 1057). So a stub is always theme.foreground at strokeOpacity: 0.28. ChartAxisTickOptions has count, spacing, values, size, padding, format and motion, but no style.
Result: if you color the axis line, the stubs keep the default color, and you cannot match them.
(b) ticks: false hides the labels too, and changes the tick count
tickLabelPresentation returns false when axis.ticks === false (dist/scene.js, about line 1155), so the labels go away with the stubs. resolveTickCount also uses a different fallback count when ticks is false (about line 1127).
Users who come from Recharts (tickLine={false}) or from D3 think of "ticks" as the stub lines. They write ticks: false to remove the stubs, and lose the labels. The correct option is ticks: { size: 0 }, but we found it only by reading the source.
Minimal repro
import { defineChart, lineY } from '@tanstack/charts';
import { scaleLinear } from '@tanstack/charts/scales/linear';
const rows = [
{ x: 0, y: 1 },
{ x: 1, y: 3 },
{ x: 2, y: 2 },
];
// (a) The axis line is red, the stubs stay at the default color.
export const styled = defineChart({
marks: [lineY(rows, { x: 'x', y: 'y' })],
scales: {
x: {
scale: scaleLinear,
axis: { line: { stroke: 'red', strokeOpacity: 1 } },
},
y: { scale: scaleLinear },
},
});
// (b) The stubs and the labels both disappear.
export const noStubs = defineChart({
marks: [lineY(rows, { x: 'x', y: 'y' })],
scales: {
x: { scale: scaleLinear, axis: { ticks: false } },
y: { scale: scaleLinear },
},
});
Expected
- (a) A way to style the stubs, for example a
ticks.line?: ChartGuideLineStyle | false. Or the stubs inherit the axislinestyle. - (b) The docs say clearly that
ticks: falseremoves the labels too, and thatticks: { size: 0 }removes only the stubs. Aticks.line: falsefrom (a) would make this more obvious.
Actual
- (a) The stubs always use the theme foreground at 0.28 opacity.
- (b)
ticks: falseremoves the labels and changes the tick count.
Our workaround
We set ticks: { size: 0 } on each axis that had tickLine={false} in Recharts. We have no workaround for (a), but our designs did not need styled stubs after we removed them.
Related
- https://github.com/TanStack/charts/issues/131 (grid and axis stroke treatment, closed)
- https://github.com/TanStack/charts/pull/148 (static guide line styles, merged)
Written by an agent (Claude Code, claude-opus-5-5).
- Lenguaje dominante
- TypeScript
- Estrellas
- 842
- Forks
- 53
- Merge medio
- 4 h 40 min
- PR fusionados (30 d)
- 16
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 TanStack/charts
-
[Bug] Focus guides: `url(#id)` paints ignore `idPrefix`Posiblemente ocupada @getdownandcode la tomó hace 6 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
TanStack/charts#211 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug] Printed charts keep their screen width: resize redraw waits for an animation framePosiblemente ocupada @piecyk la tomó hace 5 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
[Feature] Readable outside labels for crowded pie and donut chartsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
TanStack/charts#227 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 42/100
TanStack/charts#216 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 57/100
Los mantenedores suelen responder en 1 día
Todos los issues de TanStack/charts
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
jessepollak/home#2223 ·
Los mantenedores suelen responder en 1 día
-
grep fixture corpus test follows the corpus's loop symlink under the receipt runner (fails on main)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
code-yeongyu/senpi#3756 ·
Los mantenedores suelen responder en 1 día
-
org:external package:deepagents priority:triage topic:memory topic:middleware type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
langchain-ai/deepagents#7059 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
osmlab/name-suggestion-index#12992 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
hemilabs/ui-monorepo#2506 ·
Los mantenedores suelen responder en 1 día