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

140
Vistas
Not able to display my graph the same as my picture using react recharts

I'm trying to plot this picture and I really don't know how to do that. I can display radars, bars graphs but this one I don't know. I'm using recharts library. Reagarding the value, it's not necessarilary mandatory to get total 100% by addind notValidated and validated fields. And if you pass the cursor, you get a gray transparent bar and it shows more information on the values (see the picture please)

Here what I've tried to get only the vertically bars :

export default function GraphsPlot() {

    const { gradesPlot, validationPlot } = graphs ?? {}
    ...
    function validationBar() {
        data = validationPlot
        return ({
            title: 'Grades',
            graph: {
                type: 'bar',
                showTooltip: true,
                showXAxis: true,
                showYAxis: true,
                container: {
                    data,
                },
                bars:
                    [
                        {
                            dataKey: 'validated',
                            cells: data.map(d => ({
                                stroke: 'transparent',
                                fill: 'green'
                            }))
                        }
                    ],
                [
                    {
                        dataKey: 'notValidated',
                        cells: data.map(d => ({
                            stroke: 'transparent',
                            fill: 'red'
                        }))
                    }
                ],
                xaxis: {
                    dataKey: 'title',
                    interval: 0,
                    tick: { style: { fontSize: '.9rem' } },
                },
                yaxis: {
                    dataKey: 'Grades',
                    domain: [0, 100],
                },
            },
        }).graph
    }
    return (
        { ...validationBar() }

    )
}

Here is the json from my api :

{
        "gradesPlot": [...],
        "validationPlot": [
            {
                "title": "Maths",
                "notValidated": 25,
                "validated": 75,
            },
            {
                "title": "Physics",
                "notValidated": 10,
                "validated": 30,
            },
        ]
}

Please see the picture :enter image description here

about 4 years ago · Juan Pablo Isaza
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