I want to create a chart where I can represent my movie scenes (each scene is divided into blocks) data using time scale.block for each scene, for example, my data looks like:
{label: "Scene 1", times: [{"color":"blue", "label":"block 1 ", "starting_time":28, "ending_time": 42},{"color":"green", "label":"block 2", "starting_time":42, "ending_time": 72},]},
{label: "Scene 3", times: [{"color":"red", "label":"block 1 ", "starting_time":121, "ending_time": 126},]},
the problem is that my starting_time and ending_time are in second, but I want something like that (HH:MM:SS) in the time axis
I try this:
var chart = d3.timeline()
.relativeTime()
.tickFormat({
format: function(d) { return d3.time.format("%X")(d) },
tickTime: d3.time.minute,
tickInterval: 15,
tickSize: 10,
});
but it shows nothing in the time axis.
var chart = d3.timeline()
.relativeTime()
.tickFormat({
format: d3.timeFormat("%H:%M:%S"),
tickTime: d3.time.minute,
tickInterval: 15,
tickSize: 10,
});
--
You received this message because you are subscribed to a topic in the Google Groups "d3-js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/d3-js/6wB6Y3zqHWQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to d3-js+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "d3-js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/d3-js/6wB6Y3zqHWQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to d3-js+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
var start_seconds = 1234;
var start_time = new Date(start_seconds * 1000);
--
You received this message because you are subscribed to a topic in the Google Groups "d3-js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/d3-js/6wB6Y3zqHWQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to d3-js+unsubscribe@googlegroups.com.
var testDataRelative = [
{times: [{"starting_time": 2, "ending_time": 40}, {"starting_time": 50, "ending_time": 250}]},
{times: [{"starting_time": 300, "ending_time": 1000}]},
{times: [{"starting_time": 1500, "ending_time": 3000}]}
];
var epoch = new Date(70, 0, 1);
testDataRelative.forEach(function (r) {
r.times.forEach(function (t) {
t.starting_time = t.starting_time * 1000 + epoch.getTime();
t.ending_time = t.ending_time * 1000 + epoch.getTime();
});
});
var chart = d3.timeline()
.beginning(epoch)
.tickFormat({
format: d3.time.format("%H:%M:%S"),
tickTime: d3.time.minutes,
tickInterval: 5,
tickSize: 10
});