![]() |
VOOZH | about |
D3.js is a library built with javascript and particularly used for data visualization. But this is not only, we can also fetch files of different formats such as xml, csv, pdf etc. using d3-Fetch API.
Importing the d3-Fetch API:
<script src = "https://d3js.org/d3.v4.min.js"></script> <script src="https://d3js.org/d3-fetch.v1.min.js"></script>
Syntax:
d3.csv(filelocation).then(function);
Types of file it can fetch:
NOTE: It is essential to create the file before fetching the file. Otherwise it throw error.
Example 1:
Output:
Example 2: