We have prepared a sample Node.js server that implements the custom data source API. It is available on our GitHub.
To run our sample Node.js server, complete the following steps.
Step 1.1. To get our sample project, download it as ZIP or clone it with the following command:
git clone https://github.com/flexmonster/api-data-source
Step 1.2. The sample Node.js server is available in the server-nodejs/ folder. Navigate to this folder:
cd api-data-source/server-nodejs
Install the npm dependencies described in the package.json file:
npm install
To start the server, run the following commands in a console:
npm start
All requests from Flexmonster Pivot are handled by the http://localhost:3400/api/cube endpoint.
Raw data is stored in JSON format in the server-nodejs/data/ folder.
On the client side (e.g., /client/index.html), the report should be configured as follows:
new Flexmonster({
container: "pivotContainer",
report: {
dataSource: {
type: "api",
url: "http://localhost:3400/api/cube",
index: "fm-product-sales"
}
}
});The dataSource.index property must match the name of the JSON file from the server-nodejs/data/ folder.
To see Flexmonster with the data from the sample Node.js server, open the client/index.html file in a browser.
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.