-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot.js
19 lines (18 loc) · 836 Bytes
/
plot.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
fetch('https://api.covid19india.org/data.json').then((response) => {
response.json().then((data) => {
let datalist = data.statewise;
let state = (datalist.map(i => i.state)).slice(1);
let active = (datalist.map(i => i.deaths)).slice(1);
// console.log(state);
// console.log(active);
var data = [{
x: state,
y: active,
type: "bar"
}];
var layout = {
title: "Covid 19 Death Rate"
};
Plotly.newPlot("disdis", data, layout);
})
})