Ensure candlestick chart works with either our own date formats as well as timestamps
This commit is contained in:
parent
4754f7e0b9
commit
732685ec60
|
@ -59,8 +59,9 @@
|
||||||
.xType("datetime")
|
.xType("datetime")
|
||||||
|
|
||||||
// Add data
|
// Add data
|
||||||
|
const parseDate = d => (isNaN(d) ? Date.parse(d).valueOf() : parseInt(d))
|
||||||
const chartData = data.map(row => ({
|
const chartData = data.map(row => ({
|
||||||
x: row[dateColumn],
|
x: parseDate(row[dateColumn]),
|
||||||
y: [row[openColumn], row[highColumn], row[lowColumn], row[closeColumn]],
|
y: [row[openColumn], row[highColumn], row[lowColumn], row[closeColumn]],
|
||||||
}))
|
}))
|
||||||
builder = builder.series([{ data: chartData }])
|
builder = builder.series([{ data: chartData }])
|
||||||
|
|
Loading…
Reference in New Issue