Code Monkey home page Code Monkey logo

Comments (3)

igiagkiozis avatar igiagkiozis commented on May 18, 2024

Hi @mindv0rtex,

If you convert your datetimes to strings and use these instead you will get a time-series plot. I know this is not entirely intuitive but this is how the underlying library works (i.e. plotly.js). I have planned adding support for chrono in a future release so that you can just pass a vector of dates and get what you expect.

from plotly.rs.

yan-zaretskiy avatar yan-zaretskiy commented on May 18, 2024

Is there any specific format that plotly.js needs to recognize datetime objects? My data is defined with the granularity of milliseconds. Should I use the 'yyyy-mm-dd HH:MM:SS.ssssss' format?

Also, is there a way to control the resulting tick format for dates?

Thank you!

from plotly.rs.

mfreeborn avatar mfreeborn commented on May 18, 2024

For posterity, chrono::datetime::DateTime::to_rfc3339() will do the conversion in a way that Plotly can interpret.

Tick formatting is available via Axis::tick_format, with the JS reference docs here.

from plotly.rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.