FusionCharts - Gallery Example - Area 2D Chart

Created using FusionCharts Suite XT - www.fusioncharts.com

by Saneesh K V

HTML

<script src="https://cdn.fusioncharts.com/fusioncharts/latest/fusioncharts.js"></script>
<div id="container">FusionCharts will render here</div>

JavaScript

const URL_DATA = 'https://raw.githubusercontent.com/fusioncharts/dev_centre_docs/master/assets/datasources/fusiontime/examples/themes-in-fusiontime/data.json';
const URL_SCHEMA = 'https://raw.githubusercontent.com/fusioncharts/dev_centre_docs/master/assets/datasources/fusiontime/examples/themes-in-fusiontime/schema.json';

const jsonify = res => res.json();
const dataFetch = fetch(URL_DATA).then(jsonify);
const schemaFetch = fetch(URL_SCHEMA).then(jsonify);

Promise.all([dataFetch, schemaFetch]).then(([data, schema]) => {
  var fusionTable = new FusionCharts.DataStore().createDataTable(data, schema);

  new FusionCharts({
        type: "timeseries",
        renderAt: "container",
        width: "90%",
        height: 500,
        dataSource: {
          data: fusionTable,
          chart: {
            theme: "candy" //Apply theme
          },
          yAxis: [
            {
              plot: {
                title: "Sales ($)"
              }
            }
          ],
          caption: {
            text: "Online Sales of a SuperStore in the US"
          }
        }
      }).render();

});