Public
Edited
Nov 2, 2022
Insert cell
Insert cell
test = d3.json(`https://finnhub.io/api/v1/stock/symbol?exchange=US&token=${Secret("finnhub")}`)
Insert cell
symbols = test.map(x => x.symbol).sort((a,b) => {
return a.localeCompare(b)
})
Insert cell
viewof stockSymbol = Inputs.select(symbols, {
label: "Select a company"
})
Insert cell
viewof stockSymbol2 = Inputs.select(symbols, {
label: "Select a company"
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
color: {
domain: [stockSymbol, stockSymbol2]
},
marks: [
Plot.ruleY([0]),
Plot.line(candleData, {x: "Date", y: "Closing Price", stroke: "orange"}),
Plot.line(candleData2, {x: "Date", y: "Closing Price", stroke: "#4e79a7"})
],
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more