I’m new to Observablehq and am trying to create a relatively simple scatterplot.
I’ve imported an Excel spreadsheet and parsed the data it contained into a JS array. I’ve managed to work out most things so far, but I am struggling with the date format.
To make things simple, I changed all dates into years (initially the prices in the spreadsheet were divided into yearly quarters but it produced some weird results).
So even the simplified version of the years’ sequence (2019, 2020, and so on) is unfortunately formatted with a ,
(comma) - due to my locale, I presume, although I am not 100% sure.
It looks really ugly to have 2,019
2,020
etc
It’s been a while since I’ve dabbled with js, so I’m a bit lost on how to best manage it - docs mention (1234).toLocaleString(undefined, {useGrouping: false})
So I guess I’d have to iterate over the array to access the Year
property and strip it of the default formatting using the above mention method…
Or perhaps there’s another way of handling this?
Any help will be much appreciated
Snippet of the array
wtorny = Array(93) [
0: Object {
city: "Krakow"
Year: 2006
medianPrice: 7114
}
1: Object {
city: "Krakow"
Year: 2007
medianPrice: 8369
}