Code Monkey home page Code Monkey logo

Comments (5)

minyor avatar minyor commented on August 14, 2024 1

Anyone? How can one put hours and minutes in dates?
Seconds?
No example there...

from techan.js.

minyor avatar minyor commented on August 14, 2024

Unix datestamps in place of dates are not working.
How can I put data in chart with time not just date?

from techan.js.

minyor avatar minyor commented on August 14, 2024

I mean, what date format should I put here:
{
"Date": "28-Apr-2019",
"Open": "0.291600",
"High": "0.291700",
"Low": "0.291400",
"Close": "0.291700",
"Volume": "23"
},
To specify hours and minutes?
Thanks

from techan.js.

minyor avatar minyor commented on August 14, 2024

Huh, found the solution.
Located line:
var parseDate = d3.timeParse("%d-%b-%y");

Changed it to:
var parseDate = d3.timeParse("%d-%b-%y %H:%M");

Who needs dates with days only?
Very confusing examples you have here...

Anyways. now dates like "28-Apr-2019 04:30" works.
Hope it helps someone.

from techan.js.

trasherdk avatar trasherdk commented on August 14, 2024

From the samples:

Date,Open,High,Low,Close,Volume
9-Jun-14,62.40,63.34,61.79,62.88,37617413
6-Jun-14,63.37,63.48,62.15,62.50,42442096
var parseDate = d3.timeParse("%d-%b-%y");
{
  date: parseDate(d.Date),
  volume: +d.Volume,
  open: +d.Open,
  high: +d.High,
  low: +d.Low,
  close: +d.Close
}

Data with unix timestamp:

{
  date: new Date(d.time * 1000),
  volume: +d.Volume,
  open: +d.Open,
  high: +d.High,
  low: +d.Low,
  close: +d.Close
}

from techan.js.

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.