<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<div>
<h2>Connecting to JSON/CSV data at runtime without clearing the report</h2>
<p>
This example shows how to connect to remote JSON/CSV data (from a file or a
server-side script), to a local JSON/CSV file, and to inline JSON data using
the
<a href="https://www.flexmonster.com/api/updatedata/" target="_blank"
>updateData()</a> API call. Note that invoking this API call does not clear the report.
</p>
<p>
To update the data source and clear the report, use the
<a href="https://www.flexmonster.com/api/connectto/" target="_blank"
>connectTo()</a> API call.
</p>
<p>
Learn more about connecting to
<a href="https://www.flexmonster.com/doc/json-data-source/" target="_blank"
>JSON</a>
and
<a href="https://www.flexmonster.com/doc/csv-data-source/" target="_blank"
>CSV</a> data.
</p>
</div>
<button onclick="connectToRemoteJSON()">Connect to remote data</button>
<button onclick="connectToLocalJSON()">Connect to local data</button>
<button onclick="connectToInlineJSON()">Connect to inline JSON</button>
<div id="pivot-container"></div>