const baseURL = 'https://iss.moex.com//iss/history/engines/stock/markets/index/securities/RGBITR.json';
const params = new URLSearchParams([
[ 'sort_order', 'desc' ],
[ 'iss.meta', 'off' ],
[ 'iss.only', 'history' ],
[ 'history.columns', 'TRADEDATE,CLOSE' ],
]);
fetch(`${baseURL}?${params}`)
.then(r => r.json())
.then(r => {
new Chart(document.querySelector('#chart'), {
type: 'line',
data: {
labels: r.history.data.map(n => n[0]),
datasets: [ {
label: 'hello, world!!',
data: r.history.data.map(n => n[1]),
} ],
},
});
});
https://jsfiddle.net/1vp2a8x0/