Plot. lines - days
#2253
-
Hello, I am learning to use observablehq and when I make this graph, the dates on the x axis are out of phase. Thanks. lin_cal = Plot.plot({
title: "Línea de Tiempo de Calorías Diarias",
x: {
label: "Día",
type: "time",
ticks: 5,
tickFormat: d3.timeFormat("%b %d"),
},
y: {
label: "Calorías",
grid: true
},
marks: [
Plot.line(caloriasPorDia, { x: "Día", y: "Calorías", strokeWidth: 3 }),
Plot.dot(caloriasPorDia, { x: "Día", y: "Calorías", tip: true }),
Plot.ruleY([1200], { stroke: null })
],
marginBottom: 70,
}); |
Beta Was this translation helpful? Give feedback.
Answered by
Fil
Nov 24, 2024
Replies: 1 comment 4 replies
-
It's hard to tell without seeing the data, but maybe try |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
PaulaIzzo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's hard to tell without seeing the data, but maybe try
type: "utc",
instead oftype: "time",
? the "time" type works in local time, including time zone.