Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!