Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

98
Vistas
VictoryChart not change date data

I have a victory chart and two axis at the same, following this chart

https://formidable.com/open-source/victory/gallery/multiple-dependent-axes/

There is nothing much i can describe, but this chart now look like this enter image description here

But problem is i can't change the date data, althought i change the date

<VictoryAxis
  crossAxis={true}
  tickCount={12}
  data={date}
  tickFormat={(x) => {
    console.log(x);
    return x.toLocaleString("vn-vn", {
      month: "short",
      day: "numeric"
    });
  }}
/>

And the date data

const date = [
  { x: new Date(2000, 3, 4) },
  { x: new Date(2003, 4, 17) },
  { x: new Date(2004, 1, 1) },
  { x: new Date(2005, 1, 1) },
  { x: new Date(2006, 1, 1) },
  { x: new Date(2007, 2, 1) },
  { x: new Date(2008, 1, 1) }
];

But it alway show 1 jan , please help

This is live demo and data

https://codesandbox.io/s/chart2-11eut?file=/src/App.js:776-1010

Thank you so much

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Use an array:

const date = [
  new Date(2000, 3, 4),
  new Date(2003, 4, 17),
  new Date(2004, 1, 1),
  new Date(2005, 1, 1),
  new Date(2006, 1, 1),
  new Date(2007, 2, 1),
  new Date(2008, 1, 1)
];

Amend the JSX as follows:

  <VictoryAxis
  crossAxis={true}
  tickValues={date}
  tickCount={date.length}
  tickFormat={(x) => {
    return x.toLocaleString("vn-vn",
      {month: "short", day: "numeric"})
    }
  } 
/>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda