Need a special offer?Find out if your project fits.
All documentation
  • Introduction
  • Connecting to data source
  • Browser compatibility
  • Documentation for older versions
  • Integration with RequireJS

    This tutorial will help you integrate Flexmonster with the RequireJS framework. Follow this guide to set up a simple RequireJS project using Flexmonster Pivot Table & Charts.


    Step 1. Create a new project based on the sample from GitHub

    Download a .zip archive with the sample or clone it from GitHub with the following command:

    git clone
    cd pivot-requirejs

    Step 2. Install npm dependencies

    Install the npm dependencies described in package.json:

    npm install

    Step 3. Run the sample project

    Open the index.html file in the browser to see the result.

    Project structure

    Let’s take a closer look at the folder structure of this application:

    • scripts/ – the folder containing application JavaScript files:
      • 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:


    function() {
    var pivot = new Flexmonster({
    container: "pivotContainer",
    toolbar: true,
    report: ""


    <!DOCTYPE html>
    <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"
    <link rel="stylesheet" type="text/css"
    <h1>Flexmonster Sample Project</h1>
    <div id="pivotContainer"></div>

    What’s next?

    You may be interested in the following articles: