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

165
Visualizações
Is there a way to plot change of day on an hourly timescale on the x axis? ReactJS - Recharts

I'm using Recharts (A ReactJS library for charts).

On the x-axis, I want to show the date whenever the time crosses midnight. Something like this:

22:00   22:20   23:00   23:30  2010-11-17   00:15   01:30   02:00

Here is the example code: https://codepen.io/nahushf/pen/PgrgLX?editors=1010

const {BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend} = Recharts;
const data = [
      {name: '22:00', uv: 4000, pv: 2400, amt: 2400},
      {name: '22:30', uv: 3000, pv: 1398, amt: 2210},
      {name: '23:00', uv: 2000, pv: 9800, amt: 2290},
      {name: '23:30', uv: 2780, pv: 3908, amt: 2000},
      {name: '00:15', uv: 1890, pv: 4800, amt: 2181},
      {name: '00:30', uv: 2390, pv: 3800, amt: 2500},
      {name: '01:30', uv: 3490, pv: 4300, amt: 2100},
];
const SimpleBarChart = React.createClass({
    render () {
    return (
        <BarChart width={600} height={300} data={data}
            margin={{top: 5, right: 30, left: 20, bottom: 5}}>
       <XAxis dataKey="name" xAxisId={0} />
       <XAxis dataKey="name" xAxisId={1} hide/>
       <YAxis/>
       <CartesianGrid strokeDasharray="3 3"/>
       <Tooltip/>
       <Legend />
       <Bar barSize={20}dataKey="uv" xAxisId={1} fill="#ccc" />
       <Bar dataKey="pv" barSize={20} xAxisId={0} fill="#8884d8" />
      </BarChart>
    );
  }
})

ReactDOM.render(
  <SimpleBarChart />,
  document.getElementById('container')
);
about 4 years ago · Juan Pablo Isaza
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