Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

94
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda