This tutorial will help you integrate Flexmonster with RequireJS. Follow this guide to set up a simple RequireJS project using Flexmonster Pivot Table & Charts.
To get our sample project, download it as ZIP or clone it with the following commands:
git clone https://github.com/flexmonster/pivot-requirejs
cd pivot-requirejs
Install the npm dependencies described in package.json:
npm install
Open the index.html file in the browser to see the result.
Let’s take a closer look at the folder structure of this application:
scripts/ — the folder containing JavaScript files for the application:main.js — the main application file; this is where we embed Flexmonster.require.js — the RequireJS library.index.html — here we add the <div> container for Flexmonster.package.json — contains the description of the npm dependencies.Take a look at the contents of the key files:
requirejs(["node_modules/flexmonster/flexmonster.full.js"],
function() {
var pivot = new Flexmonster({
container: "pivotContainer",
toolbar: true,
report: "https://cdn.flexmonster.com/reports/report.json"
})
})
<!DOCTYPE html>
<html>
<head>
<title>Flexmonster Sample Project</title>
<!-- data-main attribute tells require.js to load
scripts/main.js after require.js loads. -->
<script data-main="scripts/main"
src="scripts/require.js">
</script>
<link rel="stylesheet" type="text/css"
href="node_modules/flexmonster/flexmonster.css">
</head>
<body>
<h1>Flexmonster Sample Project</h1>
<div id="pivotContainer"></div>
</body>
</html>
If you run into any issues during the integration, visit our troubleshooting page.
Can't find your answer?
Visit the FAQ
Flexmonster Pivot Table & Charts is a JavaScript pivot table component for adding interactive reporting and data analysis to web applications. Users can summarize, filter, sort, and explore data in pivot tables and charts, drill into results, and export reports.
Flexmonster works in plain JavaScript and TypeScript projects. It also integrates with React, Next.js, Angular, Vue, Blazor, and other technologies. See all integration options.
Flexmonster supports JSON and CSV files, SQL databases, MongoDB, Elasticsearch, and Microsoft Analysis Services (SSAS). You can also connect other data sources through your own backend. See supported data sources.
Flexmonster offers licenses for internal corporate use, SaaS products, and OEM distribution. Pricing varies by license and plan. SaaS projects can also use the free SaaS Entry license during development. Learn more on the pricing page.
Yes. Flexmonster offers a 30-day free trial that lets you evaluate all its features. No credit card is required. The trial version has a watermark.
To get started with Flexmonster, follow our integration guide.