From what we have seen so far, you should already be able to create a simple bar chart. In this section, we will explore some configuration options related to large datasets, which you will probably load as an external file, and multiple datasets, which can be plotted on the same chart.
Many times, your data will be available online and you may want to load it dynamically. It's also a good idea to keep your data and code in separate files. If you have data in a CSV file, you can load it into your JavaScript code and use it to generate the chart.
JavaScript loads data asynchronously using Ajax. You can use standard Ajax, JQuery, or the ES6 fetch function, which functions like a JavaScript promise. After you load the CSV file, you need to parse it. If you only need one set of category labels and values, you can handle it without a parser.
In this example, we will use a CSV file that contains the amount of plastic waste disposed of in the oceans...