Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- TESTER = document.getElementById('tester');
- // https://flask-stub.herokuapp.com/get_data
- // var server_url = 'http://127.0.0.1:5000/get_data'
- var server_url = 'https://flask-stub.herokuapp.com/get_data';
- let data;
- fetch(server_url)
- .then(function (response) {
- return response.json();
- })
- .then(function (data) {
- console.log(data)
- let x = [];
- let y = [];
- for (let key in data) {
- x.push(key);
- y.push(data[key]);
- console.log(key);
- }
- Plotly.newPlot( TESTER, [{
- x: x,
- y: y
- }], {
- margin: { t: 0 } } );
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement