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

145
Vistas
Plotly Format Axis Date

In the following code, if I choose scatter3d instead of scatter, all parameter tickformat and title inside xaxis are completely ignored, and it is impossible to format anything under any axis.

Any suggetion would be appreciated.

Failing 3D Plot with outrageous date format

enter image description here

Working Plot with proper HH:MM:SS Format

enter image description here

function setup_plot(){
    type='scatter';
    var x=[],x0=new Date();
    for (i=0;i<5;i++){
        x[i]=new Date();
        x[i].setTime(x0.getTime()+i*12*3600000);
    }
    var trace = [
        {
            type: type,
            mode: 'lines',
            x: x,
            y: [1.0,1.0,1.0,1.0,1.0],
            z: [2.6,1.2,6.3,4.8,4.7]
        },
        {
            type: type,
            mode: 'lines',
            x: x,
            y: [2.0,2.0,2.0,2.0,.0],
            z: [3.1,2.6,4.8,3.8,1.7]
        }
    ];
    var layout = {
        title: "Failing Plot",
        xaxis:{
            title:'Dates',
            tickformat: '%H:%M:%S',
            tickformatstops: [
                {
                dtickrange: [1000,60000],
                value: '%H:%M:%S'
                },
                {
                dtickrange: [60000,3600000],
                value: '%H:%M:%S'
                },
                {
                dtickrange: [3600000,86400000],
                value: '%H:%M:%S'
                },
                {
                dtickrange: [86400000,604800000],
                value: '%d'
                }
            ]
        }
    };
    Plotly.newPlot('plot',trace,layout);

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

0

For 3d charts, axis layouts have to be provided within a scene, so

const layout = {
  scene: {
    xaxis: {
      title: 'Dates',
      ...
    }
  }
}

See https://plotly.com/javascript/3d-axes/

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