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

235
Vistas
Error while turncating x-axis label in chart js

i am trying to truncating the x-axis label in chart.js but i m getting error(value.substr is not a function) and don't know how to solve this. i also used getLabelForValue function but still getting error... anybody can help me? here is my code

const gridConfig = {
    display: false,
    borderWidth: 0,
}
const xAxis = {
    barPercentage: 0.4,
    ticks: {
        callback:function(value){
            return value.substr(0,6)
        },
        color: '#313640',
        padding: 9,
        font: {
            size: 12,
            weight: 600
        }
    },
    grid:gridConfig,
};
const timeManagmentData = {
    labels: MeetingsAdjusted,
    datasets: [{
        barThickness: 10,
        borderRadius: 100,
        backgroundColor: gradientBg2,
        borderColor: gradientBg2,
        label: 'Meetings Score',
        data: avgAnswerFeedback,
    }]
}
const timeManagmentConfig = {
    type: 'bar',
    data: timeManagmentData,
    options: {
        scales: {
            y: {
                ticks: yAxisTicks_stepSize20,
                grid:gridConfig
            },
            x: xAxis,
        },
        plugins: {
            tooltip,
            legend,
        },
        animation,
    },
}
const myChart = new Chart(
    ctx3,
    timeManagmentConfig,
);

about 4 years ago · Santiago Gelvez
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