Data Adapter

Overview

AnyChart JavaScript charting framework supports several ways of setting data. For the information about this see Overview, Using Data Sets and Supported Data Formats articles - these are things built-in into AnyChart core engine.

Data Adapter is an additional script that can do even more: load CSV, JSON and XML files, load data from HTML Tables and Google Spreadsheets.

To work with the features Data Adapter provides you need to plug it in along with AnyChart Library:

<!-- Include the data adapter -->
<script src="https://cdn.anychart.com/releases/8.0.1/js/anychart-data-adapter.min.js"></script>

HTML Tables

Parsing HTML tables feature allows you to load data from HTML table into AnyChart, it is provided by the parseHtmlTable() method:

See detailed description and samples in Parsing HTML Table article.

Loading Files

CSV File

You can load Data from CSV into AnyChart without the help of Data Adapter but if you want to load a file you can do it using the data adapter and the loadCsvFile() method:

See details in Loading CSV File article.

NOTE: you can load CSV files using any other AJAX method of your choice, be it jQuery or any other capable library, data adapter is just a helper script in this case.

Google Spreadsheet

Data Adapter allows you to load data for AnyChart charts from spreadsheets created with Google Sheets using the {api:anychart.data#loadGoogleSpreadsheet}loadGoogleSpreadsheet(){} method:

See details in Loading Google Spreadsheet article.

JSON File

You can load Data from JSON into AnyChart without the help of Data Adapter but if you want to load a file you can do it using the data adapter and the loadJsonFile() method, or deserialize chart from JSON file using the fromJsonFile() method:

See details in Loading JSON File article.

NOTE: you can load JSON files using any other AJAX method of your choice, be it jQuery or any other capable library, data adapter is just a helper script in this case.

XML File

You can load Data from XML into AnyChart without the help of Data Adapter but if you want to load a file you can do it using the data adapter and the loadXmlFile() method, or deserialize chart from XML file using the fromXmlFile() method:

See details in Loading XML File article.

NOTE: you can load XML files using any other AJAX method of your choice, be it jQuery or any other capable library, data adapter is just a helper script in this case.