FusionCharts - Gallery Example - Area 2D Chart

Created using FusionCharts Suite XT - www.fusioncharts.com

by FusionCharts

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/online-sales-single-series/data.json';
const URL_SCHEMA = 'https://raw.githubusercontent.com/fusioncharts/dev_centre_docs/master/assets/datasources/fusiontime/examples/online-sales-single-series/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: 490,
    dataSource: {
      data: fusionTable,
      chart: {
      exportEnabled: 1
      },
      caption: {
        text: 'Online Sales of a SuperStore in the US'
      },
      yAxis: {
        "plot": {
          "value": "Sales",
          "type": "line"
        },
      }
    }
  }).render();

});