Write a javascript program that downloads data from an API and displays it on a graph. Use a government API.
I recommend using jsfiddle or other online editor.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ZingSoft Demo</title>
<script src="https://cdn.zingchart.com/zingchart.min.js"></script>
<style>
body {
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
#chart-one {
height: 75%;
width: 80%;
margin: 0 auto;
}
</style>
</head>
<body>
<div id="chart-one"></div>
<script>
ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
const fetchParams = {
method: "GET",
mode: "cors",
cache: "default"
};
const url = "https://swapi.py4e.com/api/people/";
fetch(url, fetchParams)
.then(res => {
if (!res.ok) {
throw new Error(res.statusText);
}
return res.json();
})
.then(data => {
const characters = data.results;
let characterData = [];
characters.forEach(function(character) {
characterData.push([character.name, parseInt(character.height)]);
});
const chartOneData = {
type: "bar",
title: {
text: " Demo",
adjustLayout: true
},
tooltip: {
text: 'Name: %kt<br>Height: %vvcm'
},
scaleX: {
label: {
text: 'Characters'
},
item: {
angle: '-45'
}
},
scaleY: {
label: {
text: 'Height In CM'
}
},
series: [{
values: characterData
}],
plotarea: {
margin: 'dynamic'
}
};
zingchart.render({
id: "chart-one",
data: chartOneData,
height: "100%",
width: "100%"
});
})
.catch(err => {
console.log("Error Getting Data From Star Wars API");
});
</script>
</body>
</html>
Write a javascript program that downloads data from an API and displays it on a graph....
Write a JSON mobile app using JavaScript: fetch API for 5
authors (Lao Tzu, Abraham L., Aristotle, Bo Jackson, Leonardo Da
V.) inspirational quotes using below links. Describe code in
comments, include HTML and style pages to be processed in brackets.
Use the below example format for the app: Keep it simple.
https://www.freecodecamp.org/forum/t/free-api-inspirational-quotes-json-with-code-examples/311373
https://type.fit/api/quotes
Current Weather Get Weather San Diego, CA Select the city then press button for current weather City: San Diego Condition: scattered clouds Temperature: 71.08 deg...
Write a Java program that uses a java mail API that sends an encrypted email from google mail using TLS and giving the MAIL FROM, MAIL TO, SUBJ, and message
I need help with a javascript assignment: Write a program called sum_number.js, that calculates the sum of the numbers contained in a string and displays the result. Use a string containing “2155” as your input value. For example, given the input , let num = “22”, I would sum 2 + 2 for a result of 4. The power is the amps at a given hour times the voltage at the same hour. Calculate the average power consumed for the...
1. Write a program that reads a sequence of numbers from the keyboard, and displays the smallest number. The sequence has at least one number and is terminated by -999(-999 will not appear in the sequence other than as the end marker). 2. Write a program which requests an integer input n from the keyboard and computes the sum of square of k for all k from 1 to n(inclusive). use java
Write a program that discovers and displays all the Hamiltonian Cycles of a Weighted, Non-directed graph (In Java).
Write a program that gets an integer value from the user. Then
it finds and displays its factorial using the following
approximation
Use the function pow(x,n) and exp(x) from math.h
3 f= n! = nn e n
(b) Write a JavaScript function that displays the 216 web safe colours with their hex values in a 36 × 6 table. In an RGB colour model, assigning each of the Red, Green, Blue components with a value from [00, 33, 66, 99, CC, FF] will create a web safe colour, for example, #3366FF Use the DOM methods createElement ) and appendChild() to write the function. Working code using other DOM methods may receive partial marks <html> head> <title>Web Safe...
Write a Python program n_kids.py that reads the data from n_kids.txt, does some math, then displays the following: Total number of families: Total number of kids: Average number of kids per family: Maximum number of kids in a family: Minimum number of kids in a family: Extra credit (2 pts): write the above results to a different file (results.txt, not to the input file n_kids.txt) in addition to displaying them on the screen. Do not use built-in min and max...
Write a program that obtains two numbers from the user and displays the larger of the two numbers. Use if-else
Write a regression model in R that gets data from a public API.