The <Flexmonster> component embeds Flexmonster into a Svelte application.
To add an empty pivot table, specify the <Flexmonster> tag without any props and attributes:
<Flexmonster />
Learn more about integration with Svelte.
All the <Flexmonster> props are equivalent to the parameters of the new Flexmonster() API call. Check out the full list of available props.
Note that <Flexmonster> supports only Flexmonster-specific props. Any other props are not supported, including id, class, or style.
Props can be passed as hardcoded values or as variables:
To pass a prop as a hardcoded value, enclose it in single or double quotes or leave it unquoted. If the value is a boolean or other JavaScript expression, use curly braces.
Example:
<Flexmonster
toolbar={true}
report="https://cdn.flexmonster.com/reports/report.json"
/>
<Flexmonster
report={report}
/>
The specified variable (in our case, the report) should be defined in the <script> section of the file.
Learn how to pass values to the component.
Svelte lifecycle hooks are not synchronized with Flexmonster's lifecycle. However, you can get information about Flexmonster's state using its events.
To track the initialization of Flexmonster, use the ready or the reportcomplete event. Changes in Flexmonster's state (e.g., a report is changed) can be tracked via other Flexmonster events.
Learn more about using Flexmonster events in Svelte.
The following example demonstrates how different <Flexmonster> props can be specified:
<Flexmonster
bind:pivot
toolbar={true}
report="https://cdn.flexmonster.com/reports/report.json"
height="600"
beforetoolbarcreated={toolbar => {
toolbar.showShareReportTab = true;
}}
customizeCell={customizeCellFunction}
/>
Here is the full list of available props.
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.