Time series chart with a million data points


js
Copy
Promise.all([
  loadData(
    "https://s3.eu-central-1.amazonaws.com/fusion.store/ft/data/ibm-data-data.json"
  ),
  loadData(
    "https://s3.eu-central-1.amazonaws.com/fusion.store/ft/schema/ibm-data-schema.json"
  )
]).then(function(res) {
  const data = res[0];
  const schema = res[1];

  const dataStore = new FusionCharts.DataStore();
  const dataSource = {
    chart: {},
    caption: {
      text: "Stock history of IBM"
    },
    subcaption: {
      text: "Over one million data points"
    },
    yaxis: [
      {
        plot: {
          value: "Closing Price",
          connectnulldata: true
        },
        format: {
          prefix: "$"
        },
        title: "Closing Stock Price"
      }
    ]
  };
  dataSource.data = dataStore.createDataTable(data, schema);

  new FusionCharts({
    type: "timeseries",
    renderAt: "chart-container",
    width: "100%",
    height: "500",
    dataSource: dataSource
  }).render();
});
html
Copy
<div id="chart-container"></div>