A Pen by Fabrizio Giordano on CodePen.
Last active
November 9, 2021 00:48
-
-
Save micheleberardi/fa5b65e1a3f6d2c7a3fe9780501bd720 to your computer and use it in GitHub Desktop.
BadxMMy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="https://unpkg.com/lightweight-charts@3.4.0/dist/lightweight-charts.standalone.production.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async () => { | |
const chart = LightweightCharts.createChart(document.body, { | |
width: 600, | |
height: 300, | |
layout: { | |
backgroundColor: "#000000", | |
textColor: "rgba(255, 255, 255, 0.9)" | |
}, | |
grid: { | |
vertLines: { | |
color: "rgba(197, 203, 206, 0.5)" | |
}, | |
horzLines: { | |
color: "rgba(197, 203, 206, 0.5)" | |
} | |
}, | |
crosshair: { | |
mode: LightweightCharts.CrosshairMode.Normal | |
}, | |
rightPriceScale: { | |
borderColor: "rgba(197, 203, 206, 0.8)" | |
}, | |
timeScale: { | |
borderColor: "rgba(197, 203, 206, 0.8)" | |
} | |
}); | |
const candleSeries = chart.addCandlestickSeries({ | |
upColor: "rgba(255, 144, 0, 1)", | |
downColor: "#000", | |
borderDownColor: "rgba(255, 144, 0, 1)", | |
borderUpColor: "rgba(255, 144, 0, 1)", | |
wickDownColor: "rgba(255, 144, 0, 1)", | |
wickUpColor: "rgba(255, 144, 0, 1)" | |
}); | |
const response = await fetch("https://api.cryptomike.io/v1.0/api/td?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9&ticker=tsla"); | |
const data = await response.json(); | |
console.log(data); | |
candleSeries.setData(data); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment