<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nika</title>
    <description>The latest articles on DEV Community by Nika (@veronikaro).</description>
    <link>https://dev.to/veronikaro</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F119595%2Ff1137cc8-620f-4b43-9b33-4480e2e1d435.png</url>
      <title>DEV Community: Nika</title>
      <link>https://dev.to/veronikaro</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/veronikaro"/>
    <language>en</language>
    <item>
      <title>Beautiful Dark Mode Dashboard for Analytics</title>
      <dc:creator>Nika</dc:creator>
      <pubDate>Wed, 15 Apr 2020 14:20:29 +0000</pubDate>
      <link>https://dev.to/veronikaro/beautiful-dark-mode-dashboard-for-analytics-5148</link>
      <guid>https://dev.to/veronikaro/beautiful-dark-mode-dashboard-for-analytics-5148</guid>
      <description>&lt;p&gt;This pen shows how to create a  dashboard with a pivot table and charts on your web page and apply a dark theme to it. &lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/flexmonster/embed/oNvpbOy?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>codepen</category>
    </item>
    <item>
      <title>JavaScript Data Visualization in Jupyter Notebook</title>
      <dc:creator>Nika</dc:creator>
      <pubDate>Thu, 09 Apr 2020 14:38:05 +0000</pubDate>
      <link>https://dev.to/veronikaro/javascript-data-visualization-in-jupyter-notebook-320f</link>
      <guid>https://dev.to/veronikaro/javascript-data-visualization-in-jupyter-notebook-320f</guid>
      <description>&lt;p&gt;Have you ever tried to make notebooks and the JavaScript environment work together well? &lt;/p&gt;

&lt;p&gt;I'd like to share my story of how I was trying to make JavaScript and notebooks friends. &lt;/p&gt;

&lt;p&gt;But why would anyone want to use JavaScript in Jupyter? Let's reveal the motivation behind this idea. &lt;/p&gt;

&lt;p&gt;Working in the notebook with Python, you may face the need to use the data visualization library that might not have a version for Python. Sure, Python has a rich ecosystem and chances that you'll find an alternative solution are quite high. But what if above all other libraries you'd like to use exactly this one you like most? &lt;/p&gt;

&lt;p&gt;The first thing that comes to mind is to use a &lt;strong&gt;JavaScript kernel&lt;/strong&gt;. And this sounds absolutely logical. But following this approach and trying importing npm modules to my notebook, I encountered a lot of troubles in doing so. JavaScript kernels seemed to be great for running code that doesn't depend on third-party library's usage.&lt;/p&gt;

&lt;p&gt;There can be many other reasons to use JavaScript instead of Python. And regardless of the nature of these reasons, JavaScript developers deserve to experience the benefits of using this environment in full.&lt;/p&gt;

&lt;p&gt;Searching for other approaches to use a JavaScript-based data visualization library in a notebook, I almost became despair. And that was the moment when I came across &lt;strong&gt;Observable&lt;/strong&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is Observable
&lt;/h2&gt;

&lt;p&gt;As its creators say, &lt;a href="https://observablehq.com/" rel="noopener noreferrer"&gt;Observable&lt;/a&gt; is a magic notebook that helps you make the most of your data. For me, it's indeed magical: running JavaScript code in this web-based environment turned out to be easy, as well as importing a custom library.&lt;/p&gt;

&lt;p&gt;For the sake of accuracy, it's worth saying that Observable uses not plain JavaScript but rather its "flavor". You can read about all the syntax features here. &lt;br&gt;
Observable notebooks offer features you'd expect from a traditional notebook:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Quick prototyping of visualizations&lt;/li&gt;
&lt;li&gt;Running code in cells is accompanied by visual outputs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But the thing that makes Observable different is the concept of &lt;strong&gt;reactivity&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;How often do you face an exception once you run a cell and it didn't contain a variable which the current code is dependent on? I bet quite often. This is what can be solved by bringing reactivity to the cells. Reactivity means the following: once a certain cell is changed, every other cell that references it is updated as well to reflect the applied modifications. Plus, there is no need to refresh the page once you edit code. The output is changed in real-time.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To dig deeper, you can read about &lt;a href="https://observablehq.com/@observablehq/how-observable-runs" rel="noopener noreferrer"&gt;topological order&lt;/a&gt;. I hope you’ll find it fascinating and innovative as I do. &lt;/p&gt;

&lt;h2&gt;
  
  
  Differences between Jupyter Notebooks and Observable
&lt;/h2&gt;

&lt;p&gt;Before we dive into the practical part of this article, here are fundamental differences you should pay attention to:&lt;/p&gt;

&lt;p&gt;The first difference that you may find unusual is that the output is always above the code you run. &lt;br&gt;
The way you write a multi-line statement. To run it in a single cell, you need to surround it with curly braces. &lt;br&gt;
In contrast to Jupyter, cells are not executed in top-to-bottom order. As previously mentioned, the order depends on the connections between cells' contents. &lt;/p&gt;

&lt;h3&gt;
  
  
  Data visualization with Flexmonster and Observable
&lt;/h3&gt;

&lt;p&gt;I was surprised at how gracefully this project stitches together the paradigm of notebooks and JavaScript development. Out of curiosity, I started experimenting.&lt;/p&gt;

&lt;p&gt;Firstly, I imported &lt;a href="https://www.flexmonster.com/?r=dt6" rel="noopener noreferrer"&gt;Flexmonster&lt;/a&gt; - the library for web reporting using the module for &lt;a href="https://observablehq.com/@chomtana/import-external-library" rel="noopener noreferrer"&gt;importing external libraries to Observable&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Next, I've defined a &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; container using an HTML template literal. After, I've created an instance of a pivot table which would help me to summarize raw data. To see the pivot table tool rendered, I've run the cell. Then I set a report by dragging and dropping the fields on the grid, filtered the records and highlighted values with colors. And all this interactively. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note that if you're editing the report interactively, you need to save the results to JSON via the Toolbar button. This JSON can be inserted into the pivot table configuration or uploaded via the &lt;a href="https://www.flexmonster.com/api/setreport/?r=dt6" rel="noopener noreferrer"&gt;setReport&lt;/a&gt; API call.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let’s check out the results we achieved so far:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.flexmonster.com%2Ffm_uploads%2F2020%2F04%2Ffm-observable.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.flexmonster.com%2Ffm_uploads%2F2020%2F04%2Ffm-observable.png" alt="Pivot Table in Notebook"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Live demo
&lt;/h2&gt;

&lt;p&gt;The code is worth a thousand words. You can fork my &lt;a href="https://observablehq.com/@veronikaro/pivot-table-data-visualization/?r=dt6" rel="noopener noreferrer"&gt;notebook&lt;/a&gt; and play with it. I encourage you to come with your unique ways of exploring data with Flexmonster and Observable. &lt;/p&gt;

&lt;h2&gt;
  
  
  Feedback
&lt;/h2&gt;

&lt;p&gt;Please share your thoughts in the comments below. I'd be happy if you shared your experience in using Observable and other ways to avoid clumsy workarounds on making third-party libraries work in the Jupyter environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Further reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If you just like me have a Jupyter background, you may find this &lt;a href="https://observablehq.com/@observablehq/observable-for-jupyter-users?collection=@observablehq/observable-for-jupyter-users" rel="noopener noreferrer"&gt;quick start guide&lt;/a&gt; handy. It covers the basics of working with Observable. &lt;/li&gt;
&lt;li&gt;The &lt;a href="https://www.flexmonster.com/doc/getting-started/?r=dt6" rel="noopener noreferrer"&gt;quick start guide&lt;/a&gt; on using Flexmonster Pivot Table.&lt;/li&gt;
&lt;li&gt;Get familiar with D3.js in Observable notebooks: there are plenty of &lt;a href="https://observablehq.com/@d3" rel="noopener noreferrer"&gt;examples&lt;/a&gt; to get you started.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>jupyter</category>
      <category>python</category>
      <category>javascript</category>
      <category>datascience</category>
    </item>
    <item>
      <title>We've just launched WebDataRocks Pivot Table on Product Hunt! 🎉</title>
      <dc:creator>Nika</dc:creator>
      <pubDate>Wed, 18 Dec 2019 11:05:34 +0000</pubDate>
      <link>https://dev.to/veronikaro/we-ve-just-launched-webdatarocks-pivot-table-on-product-hunt-bff</link>
      <guid>https://dev.to/veronikaro/we-ve-just-launched-webdatarocks-pivot-table-on-product-hunt-bff</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Y_ZSPRYi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webdatarocks.com/wd_uploads/2019/12/wdr-screen-ph-devto.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y_ZSPRYi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webdatarocks.com/wd_uploads/2019/12/wdr-screen-ph-devto.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hey there, Dev.to community! &lt;/p&gt;

&lt;p&gt;We are working on a free data visualization tool for developers and want to share it with you! &lt;/p&gt;

&lt;p&gt;We do hope you’ll find it useful for your project.&lt;/p&gt;

&lt;p&gt;Let me introduce the product in a few words.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.webdatarocks.com/?r=devto-ph"&gt;WebDataRocks Pivot Table&lt;/a&gt;&lt;/strong&gt; is an embeddable, rich-featured JavaScript library for visualizing data and it’s analysis. You can customize it to your report logic and app’s UI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who this library is for
&lt;/h2&gt;

&lt;p&gt;It’s a real find for everyone who needs to enrich a website or application with analytics for internal or external purposes. &lt;/p&gt;

&lt;h2&gt;
  
  
  What makes it special
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The component is a &lt;strong&gt;web-based&lt;/strong&gt;, meaning you can slice &amp;amp; dice your data right in the browser. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We made the tool &lt;strong&gt;lightweight&lt;/strong&gt; and &lt;strong&gt;performant&lt;/strong&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It’s handy for developers to &lt;strong&gt;embed&lt;/strong&gt; and &lt;strong&gt;integrate&lt;/strong&gt; with any frameworks and third-party libraries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Anyone familiar with Excel will easily get used to the functionality of WebDataRocks. Since we endeavored to create a &lt;strong&gt;highly intuitive interface&lt;/strong&gt; for end-users, those who have not used Excel Pivot Tables before will be able to start reporting just as fast. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Last but not least  - it’s &lt;strong&gt;Free&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reporting features highlights
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Connecting to &lt;strong&gt;CSV&lt;/strong&gt; and &lt;strong&gt;JSON&lt;/strong&gt; data sources&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;drag-and-drop feature&lt;/strong&gt; for dynamic report composing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;17 aggregation functions&lt;/strong&gt;, multiple &lt;strong&gt;filters&lt;/strong&gt;, and &lt;strong&gt;layout&lt;/strong&gt; options&lt;/li&gt;
&lt;li&gt;Exporting to &lt;strong&gt;PDF&lt;/strong&gt;, &lt;strong&gt;Excel&lt;/strong&gt;, and &lt;strong&gt;HTML&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We've prepared a visual overview of all the core reporting features on &lt;a href="https://www.youtube.com/watch?v=ruKK8PAg6fk"&gt;YouTube&lt;/a&gt; to show you how to create your first report ✏️📝&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s new
&lt;/h2&gt;

&lt;p&gt;Here’s the list of awesome features that come with the latest updates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Auto-calculation bar&lt;/strong&gt; - check intermediate calculations real-time by selecting multiple cells on the grid&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;More connection options via UI&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript type definitions&lt;/strong&gt; for easy integration with TypeScript apps&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vue integration&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React&lt;/strong&gt; + &lt;strong&gt;TypeScript&lt;/strong&gt; integration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And more!&lt;/p&gt;

&lt;p&gt;Dive into all the release features on our &lt;a href="https://www.webdatarocks.com/blog/webdatarocks-1-2-0-top-release-highlights/?r=devto-ph"&gt;blog&lt;/a&gt;📚&lt;/p&gt;

&lt;h2&gt;
  
  
  Demos
&lt;/h2&gt;

&lt;p&gt;Play with the &lt;a href="https://www.webdatarocks.com/demos/javascript-pivot-table-demo/?r=devto-ph"&gt;demo&lt;/a&gt; to get a feel of what you can do with the component. &lt;/p&gt;

&lt;p&gt;On our &lt;a href="https://codepen.io/webdatarocks"&gt;CodePen&lt;/a&gt;, you can embrace the full variety of results you can achieve with WebDataRocks. Take a minute to check it. We hope you’ll love it!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;And one more thing…&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We’re live on &lt;strong&gt;&lt;a href="https://www.producthunt.com/posts/webdatarocks-pivot-table"&gt;Product Hunt&lt;/a&gt;&lt;/strong&gt; today!🥰&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.producthunt.com/posts/webdatarocks-pivot-table"&gt;https://www.producthunt.com/posts/webdatarocks-pivot-table&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please check out the tool and share your fair feedback about it. It would mean the world to us!&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>dataviz</category>
    </item>
    <item>
      <title>Towards Business Intelligence with React Hooks: Creating a Reporting App</title>
      <dc:creator>Nika</dc:creator>
      <pubDate>Mon, 04 Nov 2019 18:07:06 +0000</pubDate>
      <link>https://dev.to/veronikaro/towards-business-intelligence-with-react-hooks-creating-a-reporting-app-3j3l</link>
      <guid>https://dev.to/veronikaro/towards-business-intelligence-with-react-hooks-creating-a-reporting-app-3j3l</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YByApzUu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.flexmonster.com/fm_uploads/2019/11/ReactHooksBI.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YByApzUu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.flexmonster.com/fm_uploads/2019/11/ReactHooksBI.png" alt="React Hooks Business Intelligence App"&gt;&lt;/a&gt;&lt;br&gt;
The community seems to be split about &lt;a href="https://reactjs.org/docs/hooks-intro.html"&gt;React Hooks&lt;/a&gt; - a new concept introduced in the 16.8.0 release of React. While some developers met it with warmth, others have mixed feelings about it. One thing is certain - React Hooks is a hotly discussed topic in the React community that deserves to be studied more carefully. &lt;/p&gt;

&lt;p&gt;In light of its popularity, I’ve decided to do my best to give you a better idea of hooks as a concept and show how to use them to build a React app empowered with an interactive dashboard for financial reporting.&lt;/p&gt;

&lt;p&gt;Here's what you'll get as a result of completing the tutorial:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ccy6KwEb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://www.flexmonster.com/fm_uploads/2019/11/ReactHooksDemoDevTo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ccy6KwEb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://www.flexmonster.com/fm_uploads/2019/11/ReactHooksDemoDevTo.gif" alt="React dashboard with Flexmonster"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ready?&lt;/p&gt;

&lt;p&gt;Let’s start!&lt;/p&gt;
&lt;h2&gt;
  
  
  The motivation behind React Hooks
&lt;/h2&gt;

&lt;p&gt;First, let’s figure out what React Hooks are all about. The main purpose of hooks is to allow &lt;em&gt;using state management, side-effects and many other React features in function components&lt;/em&gt;. &lt;br&gt;
The great about it is that you can avoid writing redundant components as containers for business logic since it can be successfully encapsulated in hooks. &lt;br&gt;
For this reason, hooks come in handy when you have a lot of shared logic between components. With them, you are more likely to avoid the wrapper hell in React and flatten your component’s tree structure. Also, many note that hot reloading and optimization can be performed faster using hooks. &lt;/p&gt;

&lt;p&gt;Plus, many developers acknowledge that it’s easier to write tests for hooks than for class components. &lt;/p&gt;

&lt;p&gt;Finally yet importantly - function components with hooks tend to be more lightweight than their class alternatives. &lt;/p&gt;

&lt;p&gt;It’s up to you to decide whether to use hooks in your project or not. To my mind, the power of React in general and this novelty, in particular, is that you are free to choose the world you like the most - OOP or functional programming. &lt;/p&gt;
&lt;h2&gt;
  
  
  Building a React app with hooks
&lt;/h2&gt;

&lt;p&gt;Let's move on to gaining hands-on experience with hooks. In this section, I’d like to show you how it’s easy to create a user interface for a simple yet powerful analytic application writing minimum lines of code. &lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Data visualization tool for React&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To meet requirements on analytical functionality (namely pivoting and charting), we'll use &lt;strong&gt;&lt;a href="//flexmonster.com/?r=dt5"&gt;Flexmonster Pivot Table &amp;amp; Charts&lt;/a&gt;&lt;/strong&gt;. Why? Currently, it’s the only JavaScript library for web reporting I could find that supports React Hooks out-of-the-box. Besides, it’s compatible with the latest version of React. &lt;/p&gt;

&lt;p&gt;For demonstration purposes, we'll create a single-page application using the &lt;a href="https://reactjs.org/docs/create-a-new-react-app.html#create-react-app"&gt;Create React App environment&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;The next action is to set up a reporting tool inside our React project. For this, we need to take only three straightforward steps. If you want to skip the configuring steps and go straight to working with the library inside the React app, you can download a ready-to-use &lt;a href="https://github.com/flexmonster/pivot-react"&gt;project from GitHub&lt;/a&gt;, run it and customize according to your needs.&lt;/p&gt;

&lt;p&gt;But I recommend getting the feel of configuring the reporting solution by walking through the following guidelines: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;After you set up a React project, run the following command to install the Flexmonster React module:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i react-flexmonster --save
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Create a new &lt;code&gt;PivotTableHooks.js&lt;/code&gt; file in the &lt;code&gt;src&lt;/code&gt; folder and include FlexmonsterReact into it:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;FlexmonsterReact&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-flexmonster/hooks&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;In this file, we’ll be designing our function component. &lt;br&gt;
First, let's create a variable that holds the JSON data set to be analyzed later:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dataset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Revenue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Burn Rate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Net Sales&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Expenses&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Date&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;date&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Date Time&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;date string&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Discount&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Burn Rate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Revenue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;455&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Net Sales&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;250&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Expenses&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;55&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Date&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2018-02-14T07:34:08&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Date Time&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2018-02-14T07:34:08&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Discount&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;45&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="c1"&gt;/// ... &lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Secondly, create references to different instances of Flexmonster, namely a pivot table and pivot charts (there can be as many of them as you wish). All these components will be the elements of our future dashboard for financial reporting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pivot_ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useRef&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;column_chart_ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useRef&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;line_chart_ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useRef&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;line_chart2_ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useRef&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;line_chart3_ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useRef&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Next, define multiple &lt;a href="https://www.flexmonster.com/api/report-object/?r=dt5"&gt;report objects&lt;/a&gt; and set them to different pivot and chart instances:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pivot_report&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;dataSource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;dataset&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;slice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;reportFilters&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Date.Year&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;filter&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;members&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
                    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;date.year.[2018]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;date.year.[2019]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}],&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rows&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Date.Month&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;}],&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;columns&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;[Measures]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;}],&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;measures&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Revenue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aggregation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sum&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Discount&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aggregation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sum&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Net Sales&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aggregation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sum&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Gross Sales&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;formula&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sum(&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;Net Sales&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;) + sum(&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;Discount&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;caption&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Gross Sales&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Gross Profit Margin&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;formula&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;(sum(&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;Revenue&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;) - sum(&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;Net Sales&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;) ) / sum(&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;Revenue&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;caption&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Gross Profit Margin&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;format&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;percentages_formatting&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Burn Rate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aggregation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;average&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;active&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;format&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;percentages_formatting&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;conditions&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;formula&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#value &amp;gt; 6000&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;measure&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Revenue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;format&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;backgroundColor&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#00A45A&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;color&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#FFFFFF&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fontFamily&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Arial&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fontSize&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;12px&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;formula&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#value &amp;gt; 1000&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;measure&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Discount&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;format&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;backgroundColor&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#df3800&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;color&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#FFFFFF&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fontFamily&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Arial&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fontSize&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;12px&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;formats&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;percentages_formatting&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;decimalPlaces&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;isPercent&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="p"&gt;}]&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;App&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;FlexmonsterReact&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Pivot&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;pivot_ref&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;toolbar&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;100%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;report&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;pivot_report&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;reportcomplete&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;onReportComplete&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;  &lt;span class="nx"&gt;reportchange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;syncFilters&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;FlexmonsterReact&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Pivot&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;column_chart_ref&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;toolbar&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;100%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;report&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;report_column_chart&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;FlexmonsterReact&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Pivot&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;line_chart_ref&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;toolbar&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;100%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;report&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;report_line_chart&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;FlexmonsterReact&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Pivot&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;line_chart2_ref&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;toolbar&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;100%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;report&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;report_line_chart_2&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;FlexmonsterReact&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Pivot&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;line_chart3_ref&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;toolbar&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;100%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;report&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;report_line_chart_3&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;           &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;;
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Each &lt;strong&gt;report&lt;/strong&gt; contains valuable information about the data source, fields on the grid, formatting, filtering, sorting, and the layout's structure. As you may notice, it has a neat &lt;strong&gt;JSON structure&lt;/strong&gt; that is easy to digest. &lt;/p&gt;

&lt;p&gt;After we’ve initialized all the instances of Flexmonster, as a bonus, I suggest making them interconnected. We can achieve a real-time interaction between the dashboard’s elements by synchronizing their filters. Let’s implement the following scenario: make all the pivot charts react to changes in the filtering configurations of the pivot table. This can be done easily with the help of the &lt;code&gt;reportchange&lt;/code&gt; event and a custom function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;syncFilters&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;pivot_ref&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;column_chart_ref&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;line_chart_ref&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;line_chart2_ref&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;line_chart3_ref&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// apply filters from the pivot table to all the charts&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;hierarchies&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;pivot_ref&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flexmonster&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;getAllHierarchies&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;hierarchies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;column_chart_ref&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flexmonster&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;setFilter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;uniqueName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pivot_ref&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flexmonster&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;getFilter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;uniqueName&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
        &lt;span class="nx"&gt;line_chart_ref&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flexmonster&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;setFilter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;uniqueName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pivot_ref&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flexmonster&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;getFilter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;uniqueName&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
        &lt;span class="nx"&gt;line_chart2_ref&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flexmonster&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;setFilter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;uniqueName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pivot_ref&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flexmonster&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;getFilter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;uniqueName&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
        &lt;span class="nx"&gt;line_chart3_ref&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flexmonster&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;setFilter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;uniqueName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pivot_ref&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flexmonster&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;getFilter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;uniqueName&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You can take a look at how the entire code inside &lt;a href="https://github.com/veronikaro/reporting-app-with-react-hooks/blob/master/src/PivotTableHooks.js"&gt;PivotTableHooks.js&lt;/a&gt; looks like. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Import &lt;code&gt;PivotTableHooks&lt;/code&gt; to &lt;code&gt;App.js&lt;/code&gt; and make the router handle the home page:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;BrowserRouter&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;Router&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Route&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-router-dom&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;PivotTableHooks&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./PivotTableHooks&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Router&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Route&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;component&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;PivotTableHooks&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Router&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;Now it’s time to run our application and see the results in action! Type in &lt;code&gt;npm start&lt;/code&gt; in the console and open &lt;code&gt;http://localhost:3000/&lt;/code&gt;. As you see, the pivot table and pivot charts are rendered on a single web page. Coupled together, they provide different views of the same data. &lt;/p&gt;

&lt;p&gt;The end-users of your app can interact with such embedded analytics to produce insightful reports. Since all the dashboard’s elements are in sync, each time the data is filtered on the grid, it’s filtered in the pivot charts as well. &lt;/p&gt;

&lt;p&gt;It's worth noting that the reports can be configured not only with code but also via the UI. Further, they can be saved in the JSON format and exported to &lt;strong&gt;PDF&lt;/strong&gt;, &lt;strong&gt;Excel&lt;/strong&gt;, &lt;strong&gt;HTML&lt;/strong&gt;, and other formats. &lt;/p&gt;

&lt;h2&gt;
  
  
  Play with code
&lt;/h2&gt;

&lt;p&gt;You can see the full code of the sample project on my &lt;a href="https://github.com/veronikaro/reporting-app-with-react-hooks"&gt;GitHub&lt;/a&gt;.&lt;br&gt;
To play with a dashboard and explore its functionality, you can test an alternative JavaScript sample that is available on &lt;a href="https://codepen.io/ronika/full/rNNJmvR"&gt;CodePen&lt;/a&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Today we've killed two birds with one stone - practiced creating an application with React Hooks and empowered the app with a custom embedded reporting solution that is ready to tackle data analysis challenges. &lt;/p&gt;

&lt;p&gt;As you could conclude from your own experience, it takes little time to create such an app. To my mind, this is due to the ease of adding the pivot table using hooks. You can write a single import statement and "hook" the reporting functionality into your app in seconds. &lt;/p&gt;

&lt;p&gt;This tutorial provides one of the numerous scenarios of working with the component. Alternatively, you can build more complex by making the pivot table retrieve the data from your SQL/NoSQL database, OLAP cube or Elasticsearch - depending on the data source you prefer the most. &lt;/p&gt;

&lt;h2&gt;
  
  
  Feedback
&lt;/h2&gt;

&lt;p&gt;I’ll be glad to hear your feedback on the tutorial! Any suggestions for improvements are highly appreciated. &lt;/p&gt;

&lt;h2&gt;
  
  
  Discover more
&lt;/h2&gt;

&lt;p&gt;To deepen your knowledge of React Hooks, I recommend reading an &lt;a href="https://reactjs.org/docs/hooks-intro.html#motivation"&gt;official guide on React Hooks&lt;/a&gt; and &lt;a href="https://reactjs.org/docs/hooks-overview.html"&gt;Hooks at a Glance&lt;/a&gt; - an overview for experienced React users. Also, you may like the talks from &lt;a href="https://www.youtube.com/watch?v=dpw9EHDh2bM"&gt;React Conf 2018&lt;/a&gt; by Sophie Alpert, Dan Abramov, and Ryan Florence.&lt;/p&gt;

&lt;p&gt;To take a closer look at the functionality of Flexmonster, I recommend exploring its &lt;a href="https://www.flexmonster.com/demos/pivot-table-js/?r=dt5"&gt;live demos&lt;/a&gt;, &lt;a href="https://www.flexmonster.com/doc/integration/?r=dt5"&gt;tutorials on integration with frameworks&lt;/a&gt; and &lt;a href="https://www.flexmonster.com/api/?r=dt5"&gt;API reference&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>datavisualization</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Extending Business Intelligence Features of Kibana</title>
      <dc:creator>Nika</dc:creator>
      <pubDate>Mon, 08 Jul 2019 09:31:27 +0000</pubDate>
      <link>https://dev.to/veronikaro/extending-business-intelligence-features-of-kibana-2e87</link>
      <guid>https://dev.to/veronikaro/extending-business-intelligence-features-of-kibana-2e87</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aJGah3F4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.flexmonster.com/fm_uploads/2019/07/DevTo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aJGah3F4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.flexmonster.com/fm_uploads/2019/07/DevTo.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Kibana as a data visualization engine&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Features and capabilities of &lt;strong&gt;Kibana&lt;/strong&gt; are &lt;em&gt;countless&lt;/em&gt;. But Kibana can be best described as a powerful interface for accessing &lt;strong&gt;Elasticsearch&lt;/strong&gt; data and making sense of it. &lt;/p&gt;

&lt;p&gt;In most cases, Elasticsearch is used as a primary data store. But Kibana can collect diverse data in &lt;strong&gt;&lt;em&gt;one centralized place&lt;/em&gt;&lt;/strong&gt; and provide all sorts of eye-catching &lt;strong&gt;&lt;em&gt;visualizations&lt;/em&gt;&lt;/strong&gt; for analyzing this data.&lt;/p&gt;

&lt;p&gt;Later on, you can bring all created visualizations together on a single &lt;strong&gt;dashboard&lt;/strong&gt; - the &lt;strong&gt;most remarkable feature of Kibana&lt;/strong&gt;. The main purpose of these dashboards is to get a real-time picture of your data, communicate information efficiently and share it within the team. &lt;/p&gt;

&lt;p&gt;Besides, since Elasticsearch lies in the heart of the Elastic Stack, working with data is meant to be fast and delightfully easy. In general, all products of the Elastic Stack are effective in terms of development time spent for configuring.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Popular use cases&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Most common use cases of a joint work of Elasticsearch and Kibana are &lt;em&gt;log analytics&lt;/em&gt;, reporting KPIs, collecting server metrics, security analytics, various &lt;em&gt;business intelligence tasks&lt;/em&gt; and many more.&lt;/p&gt;

&lt;p&gt;Kibana is widely used in numerous industries: finance, marketing, education, energy and public services, government, healthcare, manufacturing, commerce, media and entertainment, software and technology, telecommunication, travel and a lot more.&lt;/p&gt;

&lt;p&gt;The largest companies in the world use Kibana and benefit from it. And this is not without reason. &lt;a href="https://www.elastic.co/use-cases/?r=dt4"&gt;Hundreds of use cases&lt;/a&gt; prove that Kibana and Elasticsearch empower organizations to make data-driven decisions. &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Open-source nature of Kibana&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.elastic.co/products/kibana/?r=dt4"&gt;&lt;strong&gt;Kibana&lt;/strong&gt;&lt;/a&gt; is an &lt;strong&gt;open-source product&lt;/strong&gt; and this fact has both advantages and disadvantages. A huge plus is that the product is continuously evolving and becoming better. The &lt;strong&gt;community&lt;/strong&gt; around it is indeed &lt;em&gt;vibrant&lt;/em&gt; and &lt;em&gt;active&lt;/em&gt;. Many developers are contributing to the development of Kibana's additional capabilities as a product for analysis and visualization. One of the minuses is that such development makes it difficult for developers to keep up with every new major update and make their products compatible with the latest version of Kibana.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Plugins&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Among the plugins I’ve managed to test, there is one that notably differs from the others. I’m going to cover its most noteworthy features which may improve your data-driven strategies. &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Reporting tool for Elasticsearch&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.flexmonster.com/?r=dt4"&gt;&lt;strong&gt;Flexmonster&lt;/strong&gt;&lt;/a&gt; implements the feature which many people longed to see among the available Kibana widgets, namely data &lt;strong&gt;pivoting&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Of course, there are plenty of ways to visualize your data in charts, graphs, and maps but you don’t always need exactly these types of presentation. From time to time you need to slice data and explore it interactively before sending to charts.&lt;/p&gt;

&lt;p&gt;The main &lt;strong&gt;purpose&lt;/strong&gt; of this plugin is to enable you to extract insights from the data hidden in Elasticsearch documents by displaying it in a summarized view on a grid.&lt;/p&gt;

&lt;p&gt;Besides, due to its design, it looks like a native module. &lt;/p&gt;

&lt;p&gt;What makes this plugin appealing for &lt;strong&gt;analysts&lt;/strong&gt;?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Availability of all the main &lt;strong&gt;reporting features&lt;/strong&gt; through the UI. Especially I’d like to note the user experience - when working with this tool, everything seemed intuitive and clear.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ability to &lt;strong&gt;personalize&lt;/strong&gt; the component in the way that fits your requirements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Interactivity&lt;/strong&gt;. Both in the field list and on the grid, you can drag and drop fields to change the slice of the data you want to show in the report. Each time you do it, you can see a totally different picture of your data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A choice of &lt;strong&gt;aggregation functions&lt;/strong&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Sorting&lt;/strong&gt;. The values on the grid and members of the hierarchy can be sorted with a few clicks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Filtering&lt;/strong&gt;. One can filter data by members and values.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Pivot Charts&lt;/strong&gt;. There are two modes of the component - the charts and the grid. You can switch between them via the toolbar. This is comfy because you can present the same data in multiple views in a short time. &lt;/p&gt;

&lt;p&gt;And what may &lt;strong&gt;developers&lt;/strong&gt; be interested in?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Easy connecting to the available Elasticsearch indices without need to waste time on a long setup. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ability to save all results. Reports can be stored as JSON files and uploaded later into a component through UI. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ability to export reports both via the UI. Most popular formats are available: &lt;strong&gt;PDF&lt;/strong&gt;, &lt;strong&gt;Excel&lt;/strong&gt;, &lt;strong&gt;CSV&lt;/strong&gt;, &lt;strong&gt;HTML&lt;/strong&gt;, Image. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is only a surface analysis of the component’s features which, from my perspective, look promising at first sight.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;How to create reports&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;With the available features, it’s possible to compose a tabular report of any complexity. &lt;/p&gt;

&lt;p&gt;Besides, the report’s configuration can be changed anytime later by slicing and dicing the data interactively. &lt;/p&gt;

&lt;p&gt;To concentrate on the most important aspects of data, metrics can be highlighted with &lt;em&gt;conditional formatting&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;Let me demonstrate how I’ve built a report after installing the plugin to Kibana. Open the gif in a new tab to see the entire process:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ibb.co/SwfHVND" rel="noreferrer noopener"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wmgNL9bp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://i.ibb.co/TMWJPcD/Creating-Report-Kibana-FMDev-To.gif" alt="Creating-Report-Kibana-FMDev-To"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s it! As a result, I’ve got a carefully crafted report which is ready to be shared across departments. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Personal impression&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In my judgment, the process of creating reports is time-saving and allows looking at metrics from different angles. Another thing I’ve noticed is that the component works smoothly and nicely handles large volumes of data. It would be great to add this tool to the dashboard or Canvas alongside with other visualizations. &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Final thoughts&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Here I’ve shared with you my opinion about Kibana as a powerful data visualization tool and introduced a pivot table plugin which, hopefully, will help you generate intelligible reports based on Elasticsearch documents.&lt;/p&gt;

&lt;p&gt;And what are your favorite features of Kibana? Do you use any plugins that help you analyze the data? To your opinion, what features for reporting and visualization would you like to have in Kibana? &lt;/p&gt;

&lt;p&gt;I’ll be happy to hear your thoughts. &lt;/p&gt;

&lt;p&gt;Thank you for reading!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What to check next&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/flexmonster/pivot-kibana/?r=dt4"&gt;How to install Pivot Table into Kibana&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.elastic.co/guide/en/kibana/current/known-plugins.html"&gt;A list of known plugins for Kibana&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>datavisualization</category>
      <category>bigdata</category>
      <category>elasticsearch</category>
      <category>businessintelligence</category>
    </item>
    <item>
      <title>Visualization with free JavaScript Libraries: WebDataRocks and ChartJS</title>
      <dc:creator>Nika</dc:creator>
      <pubDate>Tue, 04 Jun 2019 13:37:19 +0000</pubDate>
      <link>https://dev.to/veronikaro/visualization-with-free-javascript-libraries-webdatarocks-and-chartjs-4k0k</link>
      <guid>https://dev.to/veronikaro/visualization-with-free-javascript-libraries-webdatarocks-and-chartjs-4k0k</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yzjyTCbn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webdatarocks.com/wd_uploads/2019/06/Copy-of-Copy-of-Pivot-Table-with-chart.js-4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yzjyTCbn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webdatarocks.com/wd_uploads/2019/06/Copy-of-Copy-of-Pivot-Table-with-chart.js-4.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Today I'd like to share my experience of creating a powerful data visualization tool by using two &lt;em&gt;free JavaScript libraries&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;Mastering data visualization is a crucial skill for your career advancement that is easy to overlook in our fast-paced digital world. The ability to present the data in an understandable form and answer important questions about the business is highly appreciated in any field. As a type of data visualization, &lt;strong&gt;data dashboards&lt;/strong&gt; are incredibly instrumental for communicating insights. &lt;/p&gt;

&lt;p&gt;Hopefully, at the end of the tutorial, you'll learn how to power up your project with an interactive and customizable &lt;strong&gt;dashboard&lt;/strong&gt; which helps track specific business metrics. &lt;/p&gt;

&lt;p&gt;To complete this tutorial, you only need to have basic &lt;strong&gt;JavaScript&lt;/strong&gt; programming skills. &lt;br&gt;
In case you are eager to see the demo right now, here is the &lt;a href="https://codepen.io/ronika/pen/yWxQMr"&gt;link&lt;/a&gt; to it. &lt;/p&gt;
&lt;h2&gt;
  
  
  Data visualization tools
&lt;/h2&gt;

&lt;p&gt;Let’s start with exploring the functionality of the first tool I’ll be using, namely a &lt;strong&gt;pivot table component&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4OfxFTE_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webdatarocks.com/wd_uploads/2019/06/webdatarocks-1024x512-20181212.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4OfxFTE_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webdatarocks.com/wd_uploads/2019/06/webdatarocks-1024x512-20181212.png" alt="pivot table control" width="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.webdatarocks.com/?r=dt3"&gt;WebDataRocks&lt;/a&gt;&lt;/strong&gt; is a JavaScript pivot table which easily integrates with &lt;a href="https://reactjs.org/?r=dt3"&gt;React&lt;/a&gt;, &lt;a href="https://angular.io/?r=dt3"&gt;Angular&lt;/a&gt;, and &lt;a href="https://angularjs.org/?r=dt3"&gt;AngularJS&lt;/a&gt; frameworks. It lets you create reports based on the CSV &amp;amp; JSON data and export them to PDF, Excel or HTML. &lt;/p&gt;

&lt;p&gt;The first thing you may notice is the component’s interactiveness: you can add the fields via the field list to compose a report and drag and drop them right on the grid to get a completely new view of the data. Also, it’s possible to drill through the cells to see the raw data, apply filters and sort the records by members or values. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7gJekI6C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://www.webdatarocks.com/wd_uploads/2019/06/WorkWithWDR.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7gJekI6C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://www.webdatarocks.com/wd_uploads/2019/06/WorkWithWDR.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All these features help slice and dice your data with ease. I encourage you to explore the functionality by playing with its &lt;a href="https://www.webdatarocks.com/demos/javascript-pivot-table-demo/?r=dt3"&gt;demo&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;To my mind, this tool is perfect both for developers and the end-users: there are a lot of advanced features available via the JavaScript API and the reporting features accessible from the UI.&lt;/p&gt;

&lt;p&gt;What I liked the most is the variety of customization options for all tastes. I've managed to change the component's theme and change the icons of the toolbar. &lt;/p&gt;

&lt;p&gt;The second tool is a &lt;strong&gt;charting library&lt;/strong&gt; which you most likely heard of or even used in your projects. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hMAHpptR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webdatarocks.com/wd_uploads/2019/06/chartjs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hMAHpptR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webdatarocks.com/wd_uploads/2019/06/chartjs.png" alt="charting library" width="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.chartjs.org/?r=dt3"&gt;Chartjs&lt;/a&gt; is an open-source &lt;strong&gt;JavaScript&lt;/strong&gt; charting library that integrates with &lt;a href="https://vue-chartjs.org/?r=dt3"&gt;Vue&lt;/a&gt; and React with the help of wrappers. &lt;/p&gt;

&lt;p&gt;It’s incredibly popular among developers these days and there are reasons for that.&lt;br&gt;
The main features for which ChartJS is loved by developers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It’s &lt;em&gt;lightweight&lt;/em&gt; -  ships at only 10 KB. &lt;/li&gt;
&lt;li&gt;Charming visualizations that can spice up any data visualization project. &lt;/li&gt;
&lt;li&gt;Charts are responsive and work smoothly on any device.&lt;/li&gt;
&lt;li&gt;Everything is customizable via API - animations, tooltips, legend, and colors. Also, you can control the interaction with each element of the chart.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Another feature I’d like to draw attention to is its &lt;em&gt;brief yet comprehensive documentation&lt;/em&gt;. Looking through the articles, I’ve managed to find everything I needed to work with charts. The section about the data structure in each tutorial is especially useful - the information it contains helped me to find out everything about the data format required for certain types of charts. &lt;/p&gt;

&lt;p&gt;All in all, whether you are a beginner or a professional developer, it will be easy for you to use ChartJS.&lt;/p&gt;

&lt;p&gt;Now let’s head over to practice!&lt;/p&gt;
&lt;h2&gt;
  
  
  📝 Add WebDataRocks
&lt;/h2&gt;

&lt;p&gt;Install a pivot table by &lt;a href="https://www.webdatarocks.com/doc/download/?r=dt3"&gt;downloading a package&lt;/a&gt; into your project or simply by using the WebDataRocks CDN:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;link href="https://cdn.webdatarocks.com/latest/webdatarocks.min.css" rel="stylesheet"&amp;gt; &amp;lt;script src="https://cdn.webdatarocks.com/latest/webdatarocks.toolbar.min.js"&amp;gt;&amp;lt;/script&amp;gt; &amp;lt;script src="https://cdn.webdatarocks.com/latest/webdatarocks.js"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Create a container where the pivot table should be rendered:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div id="pivot-table-container"&amp;gt;&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Define a function which returns the JSON data. I recommend specifying the data types in the first object explicitly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;getData&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Channel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Segment&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Profit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Actual Expenses&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Budgeted Expenses&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Date&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;date&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Channel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Other&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Segment&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Stores&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Profit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;455&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Actual Expenses&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;250&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Budgeted Expenses&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;55&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Date&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2015-02-14T07:34:08&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Channel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Other&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Segment&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Stores&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Profit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;156&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Actual Expenses&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;501&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Budgeted Expenses&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;55&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Date&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2015-02-14T07:34:08&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Initialize the pivot table with some basic configurations, including the data source and container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;pivot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;WebDataRocks&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#pivot-table-container&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;toolbar&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;dataSource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;getData&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  📘 Define the slice to show on the grid
&lt;/h2&gt;

&lt;p&gt;As soon as you fill the pivot table with the data, define a slice which is a subset of your data that should be displayed in the report. Put the hierarchies to the rows, columns, and define the measures with suitable aggregations. If you need a composed aggregation, create the calculated value for the measure.&lt;/p&gt;

&lt;p&gt;Here is an example of the slice:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;slice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;reportFilters&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Date.Month&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;}],&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rows&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Channel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Segment&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;columns&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Measures&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Date.Year&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;measures&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Profit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aggregation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sum&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;}]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  🖌️ Highlight important values
&lt;/h2&gt;

&lt;p&gt;If you need to focus on individual values of the report, for example, on the highest and lowest levels of revenue, now is the best time to do it. Apply &lt;em&gt;conditional formatting&lt;/em&gt; via the UI.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B4ocpGxm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://www.webdatarocks.com/wd_uploads/2019/06/CondFormattingWDR4.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B4ocpGxm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://www.webdatarocks.com/wd_uploads/2019/06/CondFormattingWDR4.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or add &lt;code&gt;conditions&lt;/code&gt; to the report:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;conditions&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;formula&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#value &amp;gt; 2000&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;measure&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Profit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;format&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;backgroundColor&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#66BA5F&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;color&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#FFFFFF&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;formula&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#value &amp;lt; 500&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;measure&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Profit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;format&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;backgroundColor&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#D32F2F&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;color&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#FFFFFF&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  💻 Install ChartJS
&lt;/h2&gt;

&lt;p&gt;The simplest way is to include the library by using its CDN:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.js"&amp;gt;&amp;lt;/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Then you need to create two separate containers for the charts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;canvas id="lineChart"&amp;gt;&amp;lt;/canvas&amp;gt;
&amp;lt;canvas id="doughnutChart"&amp;gt;&amp;lt;/canvas&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Don't forget to specify the IDs so as to tell the library where the charts will be rendered.&lt;/p&gt;

&lt;h2&gt;
  
  
  📊 Initialize charts
&lt;/h2&gt;

&lt;p&gt;To bind the components together, we need to wait until the pivot table is successfully rendered and filled with the data, request this data, pre-process it accordingly to the format required for the line and doughnut charts, and create the charts. In case any changes are applied to the pivot’s report, we need to send the updated data to the charts.&lt;/p&gt;

&lt;p&gt;Let’s see how to implement this behaviour.&lt;/p&gt;

&lt;p&gt;Define two functions - &lt;code&gt;createLineChart()&lt;/code&gt; and &lt;code&gt;createDougnutChart()&lt;/code&gt;. To keep things simple, I’ll show how to define one of these functions - the other can be implemented in a similar way.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;createLineChart()&lt;/code&gt;, firstly, you need to get the data from the pivot control by using the &lt;a href="https://www.webdatarocks.com/doc/getdata/?r=dt3"&gt;getData()&lt;/a&gt; method which retrieves the data and asynchronously passes it to its &lt;code&gt;callbackHandler&lt;/code&gt; and &lt;code&gt;updateHandler&lt;/code&gt;. These two handlers define what should happen once the pivot table is created and updated correspondingly. If you want to specify the slice, you can pass it to &lt;code&gt;getData()&lt;/code&gt; as a property of the &lt;code&gt;options&lt;/code&gt; argument.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;createLineChart&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;webdatarocks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getData&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;slice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rows&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Channel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sort&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;asc&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;}],&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;columns&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Measures&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;}],&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;measures&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Profit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aggregation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sum&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;}]&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nx"&gt;drawLineChart&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;updateLineChart&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Secondly, you need to define the function which draws the chart and pass it to &lt;code&gt;getData()&lt;/code&gt; as &lt;code&gt;callbackHandler&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;drawLineChart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rawData&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;prepareDataFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rawData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;data_for_charts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;datasets&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
            &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;borderColor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rgba(193,46,12,1)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;backgroundColor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rgba(193,46,12,1)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt;
        &lt;span class="p"&gt;}],&lt;/span&gt;
        &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;labels&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="nx"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;responsive&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;legend&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;right&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;fontSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Profit by Channel&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="na"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;ticks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;beginAtZero&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;reverse&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="na"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;animateRotate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;animateScale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;ctx_linechart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;lineChart&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2d&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;line_chart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Chart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx_linechart&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;data_for_charts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;line&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Similarly, define the function which redraws the chart once the report is changed in some way.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;updateLineChart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rawData&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;line_chart&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;destroy&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;drawLineChart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rawData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;In the demo, you can see the implementation of &lt;code&gt;prepareDataFunction&lt;/code&gt; which iterates over the records and prepares the data for the line and doughnut charts. &lt;/p&gt;

&lt;p&gt;I’d like to mention that the ability to choose whether to use bezier curves for a line chart or not is cool. It’s known that disabling this functionality improves performance a bit because drawing a straight line is less costly on resources. &lt;/p&gt;

&lt;h2&gt;
  
  
  🎨 Enjoy the dashboard
&lt;/h2&gt;

&lt;p&gt;As a result, you have a top-notch data dashboard that lets you quickly capture insights and interact with your data - try filtering the data to see how the slice is changed both in the report and on the charts.&lt;/p&gt;

&lt;p&gt;You can add it to any project, including React, Angular, and Vue. The reports from the table can be exported to PDF and HTML. &lt;br&gt;
Besides, both components of this dashboard are free which makes them suitable for startups.&lt;/p&gt;

&lt;p&gt;Thank you for reading!&lt;/p&gt;

&lt;p&gt;I’ll be glad to see your results :) &lt;/p&gt;

&lt;h3&gt;
  
  
  Play with the demo
&lt;/h3&gt;

&lt;p&gt;See the full code on &lt;a href="https://codepen.io/ronika/pen/yWxQMr/?r=dt3"&gt;CodePen &lt;/a&gt; 💡&lt;/p&gt;

&lt;h2&gt;
  
  
  Useful links
&lt;/h2&gt;

&lt;p&gt;About WebDataRocks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.webdatarocks.com/doc/integration-with-react/?r=dt3"&gt;Integration with React&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.webdatarocks.com/doc/integration-with-angular/?r=dt3"&gt;Integration with Angular 4+&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;About Chartjs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.chartjs.org/docs/latest/?r=dt3"&gt;Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.chartjs.org/samples/latest/?r=dt3"&gt;Chartjs demos&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>datavisualization</category>
      <category>javascript</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to Create a Business Data Dashboard in React</title>
      <dc:creator>Nika</dc:creator>
      <pubDate>Mon, 27 May 2019 16:39:15 +0000</pubDate>
      <link>https://dev.to/veronikaro/how-to-create-a-business-data-dashboard-in-react-1gjb</link>
      <guid>https://dev.to/veronikaro/how-to-create-a-business-data-dashboard-in-react-1gjb</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.webdatarocks.com%2Fwd_uploads%2F2019%2F05%2FCopy-of-Pivot-Table-with-chart.js-5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.webdatarocks.com%2Fwd_uploads%2F2019%2F05%2FCopy-of-Pivot-Table-with-chart.js-5.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have you ever tried to create and embed a data dashboard into your React application? If so, you may know that finding the right data visualization tools that correspond to the requirements of a particular project can be challenging. Let me outline the main requirements: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Performance is above all&lt;/em&gt;. The dashboard should run smoothly on any browser and device. &lt;/li&gt;
&lt;li&gt;Easy integration with the underlying infrastructure of the application.&lt;/li&gt;
&lt;li&gt;A multitude of supported data sources for data analysis (CSV, JSON, databases).&lt;/li&gt;
&lt;li&gt;The dashboard should provide essential reporting features such as:&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Aggregating&lt;/em&gt;&lt;/strong&gt; raw numbers. &lt;/li&gt;
&lt;li&gt;Interactive &lt;strong&gt;&lt;em&gt;filtering&lt;/em&gt;&lt;/strong&gt; by dates and values&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Sorting&lt;/em&gt;&lt;/strong&gt; in ascending &amp;amp; descending order as well as the ability to define custom sorting rules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Grouping&lt;/em&gt;&lt;/strong&gt; data under separate dimensions.&lt;/li&gt;
&lt;li&gt;Drilling through the data.&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Crucial data visualization features include:&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;A wide range of charts that can be used for &lt;em&gt;comparing values&lt;/em&gt;, showing the &lt;em&gt;composition&lt;/em&gt; or &lt;em&gt;distribution&lt;/em&gt; of the data, analyzing &lt;em&gt;trends&lt;/em&gt; over time or expressing &lt;em&gt;relationships&lt;/em&gt; between variables.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Interactivity&lt;/em&gt;&lt;/strong&gt;. An end-user should be able to interact with the elements on charts.&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Customization options&lt;/em&gt; such as styles &amp;amp; themes. &lt;/li&gt;
&lt;li&gt;Exporting results to PDF &amp;amp; Excel. &lt;/li&gt;
&lt;li&gt;Event system. To define custom scenarios of interaction with the components, events should be supported.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Today I'd like to share with you my thoughts about using tools that meet the above-mentioned demands and work together like a charm. &lt;/p&gt;

&lt;p&gt;As a second part of the article, I’ll walk you through the process of creating a dashboard in the &lt;strong&gt;React&lt;/strong&gt; application. All you need to use are two JavaScript libraries and a little bit of your imagination :) &lt;/p&gt;

&lt;h2&gt;
  
  
  What Will You Get
&lt;/h2&gt;

&lt;p&gt;The dashboard consists of two parts - analytical and visual. The first one is a &lt;strong&gt;pivot table&lt;/strong&gt; which is responsible for performing &lt;em&gt;aggregating&lt;/em&gt; and &lt;em&gt;filtering&lt;/em&gt; the raw data that I pull from the &lt;a href="https://www.mongodb.com/?r=dt2" rel="noopener noreferrer"&gt;MongoDB&lt;/a&gt; database, the second one - a &lt;strong&gt;charting library&lt;/strong&gt; for displaying this data in the form of &lt;em&gt;appealing charts&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;To my mind, these two components are inevitable parts of any dashboard. While the pivot table takes upon itself all the necessary data transforming, the charts make this data easier to perceive for the audience. &lt;/p&gt;

&lt;p&gt;Here's a preview of the dashboard you will get as a result of accomplishing the tutorial:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.webdatarocks.com%2Fwd_uploads%2F2019%2F05%2FResultingDashboardTealTheme.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.webdatarocks.com%2Fwd_uploads%2F2019%2F05%2FResultingDashboardTealTheme.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's worth mentioning that you can save your results afterward: the pivot table allows &lt;a href="https://www.flexmonster.com/doc/export-and-print/?r=dt2" rel="noopener noreferrer"&gt;generating reports in PDF, Excel, CSV, HTML and PNG&lt;/a&gt; formats and charts can be &lt;a href="https://www.fusioncharts.com/dev/exporting-charts/using-fc-export-server/exporting-charts-as-image-and-pdf/?r=dt2" rel="noopener noreferrer"&gt;exported to PDF or an image&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Have no time for reading the entire tutorial&lt;/em&gt;? Jump straight to the last paragraph and find a link to the CodePen demo to play with. &lt;/p&gt;

&lt;p&gt;Let's start with introducing the libraries. &lt;/p&gt;

&lt;h3&gt;
  
  
  Pivot Table
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.flexmonster.com/?r=dt2" rel="noopener noreferrer"&gt;Flexmonster Pivot Table &amp;amp; Charts&lt;/a&gt; is a client-side pivot table component I’d definitely recommend for using as a part of embedded BI solution. It integrates smoothly with React and other JavaScript frameworks. But, first of all, it strikes with an abundance of data sources: &lt;strong&gt;CSV&lt;/strong&gt;, &lt;strong&gt;JSON&lt;/strong&gt;, &lt;strong&gt;SQL&lt;/strong&gt;, and &lt;strong&gt;NoSQL&lt;/strong&gt; databases, and &lt;strong&gt;Elasticsearch&lt;/strong&gt;. The second great thing is an interactive functionality that is accessible from its &lt;em&gt;user interface&lt;/em&gt;. It's possible to aggregate, filter and sort data easily at runtime: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.webdatarocks.com%2Fwd_uploads%2F2019%2F05%2FAggregationChangeFiltering.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.webdatarocks.com%2Fwd_uploads%2F2019%2F05%2FAggregationChangeFiltering.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Besides, its extensive API allows defining interactive behavior and changing the appearance of the component. The thing that I especially like is the &lt;a href="https://www.flexmonster.com/demos/cell-renderer-demo/?r=dt2" rel="noopener noreferrer"&gt;customizeCell&lt;/a&gt; API call - it helps to restyle the contents of particular cells. Another customization features are &lt;em&gt;conditional&lt;/em&gt; and &lt;em&gt;number formatting&lt;/em&gt; similar to the ones in Excel. Also, it’s possible to select one field with different &lt;em&gt;aggregation functions&lt;/em&gt; or create custom calculated values. The latter functionality is useful when you need to track important sales and marketing metrics. &lt;/p&gt;

&lt;h3&gt;
  
  
  Charting Library
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.fusioncharts.com/?r=dt2" rel="noopener noreferrer"&gt;FusionCharts&lt;/a&gt; is a charting library that works with multiple JavaScript frameworks and React is one of them. It’s loved by numerous developers around the world and there are reasons for that. The thing that I liked the most is the convenience of usage. You can display any data in spectacular charts effortlessly - the &lt;a href="https://www.fusioncharts.com/fusiontime/examples/?r=dt2" rel="noopener noreferrer"&gt;demos&lt;/a&gt; are ready to help you start the journey to the data visualization world. Another remarkable feature is the ability to change themes, labels, tooltips, and legends of the chart through configuring attributes. &lt;/p&gt;

&lt;p&gt;Check out how you can visualize the hierarchical data in a treemap:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.webdatarocks.com%2Fwd_uploads%2F2019%2F05%2FFusionTreemap.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.webdatarocks.com%2Fwd_uploads%2F2019%2F05%2FFusionTreemap.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Integrating Flexmonster with FusionCharts
&lt;/h2&gt;

&lt;p&gt;To make two components work together, you need to initialize them and integrate after. The entire process is quite straightforward:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Flexmonster dependencies.&lt;/li&gt;
&lt;li&gt;Install FusionCharts dependencies. &lt;/li&gt;
&lt;li&gt;Initialize the pivot table and feed the data into it.&lt;/li&gt;
&lt;li&gt;Create your report based on this data.&lt;/li&gt;
&lt;li&gt;Initialize charts once the pivot table is ready to provide data.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Later you’ll see that you can always return to step 4 so as to change the report, pass updated data to charts and get new insights.&lt;/p&gt;

&lt;p&gt;Since each point requires more explanation, let’s get deeper into the details. &lt;/p&gt;

&lt;h3&gt;
  
  
  Installing a Pivot Table
&lt;/h3&gt;

&lt;p&gt;After creating a single-page &lt;a href="https://facebook.github.io/create-react-app/docs/getting-started/?r=dt2" rel="noopener noreferrer"&gt;React application&lt;/a&gt;, you need to install Flexmonster as an &lt;em&gt;npm package&lt;/em&gt; and render a pivot table into an HTML container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script src="https://cdn.flexmonster.com/flexmonster.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;div id="fm-component"&amp;gt;&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;
    &lt;span class="nx"&gt;FlexmonsterReact&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Pivot&lt;/span&gt; &lt;span class="nx"&gt;toolbar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;100%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;componentFolder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://cdn.flexmonster.com/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="nx"&gt;report&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dataSource&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;dataSourceType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ocsv&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://localhost:3000/data&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="sr"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;,
&lt;/span&gt;    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fm-component&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Connect Your Data Source
&lt;/h3&gt;

&lt;p&gt;Now it's time to load your data into the component. Using the connector for MongoDB, I managed to establish a connection with the MongoDB database and pull the data from it. You can do the same by using &lt;a href="https://www.flexmonster.com/doc/mongodb-connector/?r=dt2" rel="noopener noreferrer"&gt;this tutorial&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create Report Based on the Data
&lt;/h3&gt;

&lt;p&gt;Firstly, define which part of the data you need to show on the grid. This subset of the report is called a slice. Here you can put the hierarchies into rows, columns, measures and set all the filters and/or sorting. &lt;/p&gt;

&lt;p&gt;I've tried filtering the data by months to show the revenue for two months. &lt;/p&gt;

&lt;p&gt;This is an example of the slice that can be a part of the report:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;slice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rows&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Date.Month&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;}],&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;columns&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;[Measures]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;}],&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;measures&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Revenue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aggregation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sum&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;}]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now your pivot table is rendered and filled with the data you want to concentrate on.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing Charting Library
&lt;/h3&gt;

&lt;p&gt;Setting up FusionCharts is not a problem as well - following the &lt;a href="https://www.fusioncharts.com/react-charts/?r=dt2" rel="noopener noreferrer"&gt;Integration with React&lt;/a&gt; guide leads to the successful embedding of the component in your project. After installing its &lt;em&gt;npm package&lt;/em&gt;, create a &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; container where the chart should be rendered:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script src="https://cdn.fusioncharts.com/code/latest/react-fusioncharts.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="https://unpkg.com/react-fusioncharts@2.0.1/dist/react-fusioncharts.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;div id="chart-container"&amp;gt;&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To be able to apply different themes, import the necessary scripts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script src="https://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.gammel.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src="https://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.candy.js"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Display the Data from the Table in Charts
&lt;/h3&gt;

&lt;p&gt;Each chart of the FusionCharts library accepts JSON data in a different format. Therefore, you need to pre-process the data that you request from the pivot table and provide it to the chart. There is an easy way to do it  - just add the connector of Flexmonster that handles processing the data for the appropriate type of chart. &lt;br&gt;
Here is a script to import:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script src="https://cdn.flexmonster.com/flexmonster.fusioncharts.js"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the methods from this connector are available in your application.&lt;/p&gt;

&lt;p&gt;Next, you need to implement the following logic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Wait till the pivot table is rendered and ready to provide data (you can listen to the &lt;code&gt;reportcomplete&lt;/code&gt; event for this).&lt;/li&gt;
&lt;li&gt;Request the data from the report by using the &lt;code&gt;flexmonster.fusioncharts.getData()&lt;/code&gt; API call.&lt;/li&gt;
&lt;li&gt;Prepare this data and pass it to &lt;code&gt;callbackHandler&lt;/code&gt; and &lt;code&gt;updateHandler&lt;/code&gt; where the chart is created for the first time and updated correspondingly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is an example of defining the &lt;code&gt;createChart()&lt;/code&gt; function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;createChart&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;flexmonster&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fusioncharts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getData&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;doughnut2d&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;slice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rows&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Customer Satisfaction&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;}],&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;columns&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;[Measures]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;}],&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;measures&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uniqueName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Requests&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aggregation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sum&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;}]&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nx"&gt;drawChart&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;updateChart&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;drawChart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;chartConfigs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;doughnut2d&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;500&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;350&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;dataFormat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chart&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;caption&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Customer Satisfaction&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;chartConfigs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dataSource&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;
        &lt;span class="nx"&gt;ReactFC&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;chartConfigs&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="sr"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;,
&lt;/span&gt;        &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;chart-container&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;updateChart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;chartConfigs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;doughnut2d&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;500&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;350&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;dataFormat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chart&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;caption&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Customer Satisfaction&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;chartConfigs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dataSource&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;
        &lt;span class="nx"&gt;ReactFC&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;chartConfigs&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="sr"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;,
&lt;/span&gt;        &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;chart-container&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And attaching the &lt;code&gt;createChart()&lt;/code&gt; function to &lt;code&gt;reportcomplete&lt;/code&gt; as an event handler:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;reportcomplete&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;createChart&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These snippets show how to create a single chart on the page but you can define as many charts as you need in a similar way. &lt;/p&gt;

&lt;h3&gt;
  
  
  Adding Extra Visual Features
&lt;/h3&gt;

&lt;p&gt;Need to &lt;em&gt;personalize the appearance of your dashboard&lt;/em&gt;? You can either change colors of particular elements of the charts/pivot table or apply pre-made themes to them. Or even both :) &lt;/p&gt;

&lt;p&gt;Personally, I find the teal theme of Flexmonster one of the most eye-catching. And to make the charts fit the palette of the pivot table, I specified the color palette for data plot. You can configure charts through &lt;a href="https://www.fusioncharts.com/dev/chart-attributes/?r=dt2" rel="noopener noreferrer"&gt;attributes&lt;/a&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;Save your results and check out how the chart interacts to the changes you apply to the report:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.webdatarocks.com%2Fwd_uploads%2F2019%2F05%2FLightFusionFM.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.webdatarocks.com%2Fwd_uploads%2F2019%2F05%2FLightFusionFM.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Bringing it All Together
&lt;/h3&gt;

&lt;p&gt;Today you’ve learned how to enhance your React application with an analytical business dashboard. &lt;/p&gt;

&lt;p&gt;To my mind, these two &lt;em&gt;data visualization tools&lt;/em&gt; - the pivot table and charting library - totally complement each other. With their help, you are able to create an awesome dashboard in minutes. I encourage you to experiment with your data and try multiple ways of presenting the data. &lt;/p&gt;

&lt;p&gt;Please share your results - I’ll be glad to see them!&lt;/p&gt;

&lt;p&gt;Thank you for reading!&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Play with the &lt;a href="https://codepen.io/ronika/pen/ZNaBxv/?r=dt2" rel="noopener noreferrer"&gt;live demo on CodePen&lt;/a&gt; 👩‍💻👨‍💻&lt;/p&gt;

&lt;h3&gt;
  
  
  Recommended reading
&lt;/h3&gt;

&lt;p&gt;Let me share with you all the useful links that helped me to understand how to use Flexmonster and FusionCharts in my React project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/facebook/create-react-app/?r=dt2" rel="noopener noreferrer"&gt;How to create a React app&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.flexmonster.com/doc/integration-with-react/?r=dt2" rel="noopener noreferrer"&gt;How to integrate Flexmonster with React&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.flexmonster.com/demos/integration-fusioncharts/?r=dt2" rel="noopener noreferrer"&gt;How to integrate Flexmonster with FusionCharts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.fusioncharts.com/react-charts/?r=dt2" rel="noopener noreferrer"&gt;React component for FusionCharts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.fusioncharts.com/charts/?r=dt2" rel="noopener noreferrer"&gt;FusionCharts Gallery&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>react</category>
      <category>datavisualization</category>
      <category>analytics</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Data Visualization and Web Reporting in Angular Project</title>
      <dc:creator>Nika</dc:creator>
      <pubDate>Fri, 25 Jan 2019 18:14:51 +0000</pubDate>
      <link>https://dev.to/veronikaro/data-visualization-and-web-reporting-in-angular-project-2d6f</link>
      <guid>https://dev.to/veronikaro/data-visualization-and-web-reporting-in-angular-project-2d6f</guid>
      <description>&lt;h3&gt;
  
  
  Problem &amp;amp; Motivation
&lt;/h3&gt;

&lt;p&gt;Recently I’ve faced a challenge of finding fully customizable and easy-to-integrate web components which can serve as embedded BI tools for &lt;strong&gt;analysis&lt;/strong&gt;, &lt;strong&gt;reporting&lt;/strong&gt;, and &lt;strong&gt;visualization&lt;/strong&gt; in my application. &lt;/p&gt;

&lt;p&gt;And even more difficult is to find solutions that are compatible with the Angular framework and doesn’t complicate the maintenance of the application.&lt;/p&gt;

&lt;p&gt;I guess I’m not alone in that so I’ve decided to share my experience with other developers which might face the same problem. &lt;/p&gt;

&lt;p&gt;Today I’ll cover briefly the features of &lt;strong&gt;Angular&lt;/strong&gt; and leave out other theoretical details about its the most basic concepts - I’m sure you’ll find insightful articles here in the community of dev.to and on the pages of Angular documentation. &lt;/p&gt;

&lt;p&gt;So, let me get straight to the purpose of this review -  to show how to run the analytics in an Angular application and transform the way you are creating reports with the help of two tools: a JavaScript pivot grid and a charting library. &lt;/p&gt;

&lt;p&gt;Besides, in the light of the recent framework’s updates, it may be useful to know which tools are worth to be a part of the project that is running on the latest version of Angular.  &lt;/p&gt;

&lt;p&gt;On top of this, we’ll create a simple yet powerful report which has all the potential to help in further analysis. I can’t wait to share a demo with you. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: jump right to the section with useful links which should help you to get your hands dirty with practice. &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Why Angular?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkdr8u2qb0f120fnn601j.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkdr8u2qb0f120fnn601j.gif" alt="Thinking"&gt;&lt;/a&gt;&lt;br&gt;
Let me start by sharing my thoughts on what I find the best in Angular and how it makes the development a quicker and easier process.&lt;/p&gt;

&lt;p&gt;The process of building dynamic client-side applications (single or multi-page) with Angular is accompanied with various benefits. By choosing Angular, you take advantage of the following features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;modular design&lt;/strong&gt; of code which makes the application’s components easy to manipulate. Consequently, the code is more organized and readable.&lt;/li&gt;
&lt;li&gt;Decoupled components&lt;/li&gt;
&lt;li&gt;Simplified &lt;strong&gt;MVC&lt;/strong&gt; architecture
&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;static typing&lt;/strong&gt; of TypeScript under the hood which provides type safety and makes the code easier to maintain and refactor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Powerful CLI&lt;/strong&gt; that automates the creation of an Angular application.&lt;/li&gt;
&lt;li&gt;An active and growing community of developers that share their knowledge about the framework and solutions to problems.&lt;/li&gt;
&lt;li&gt;Support for multiple platforms.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All the above-mentioned features lead to improved productivity in building the web, desktop, and mobile applications. &lt;/p&gt;

&lt;p&gt;However, Angular has a high learning curve, especially when compared with React. But the efforts put into learning and mastering it are worth the results you will achieve.&lt;/p&gt;

&lt;p&gt;Now let’s move further to the &lt;em&gt;solution for web reporting&lt;/em&gt; in your project.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What is Flexmonster&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3w4zpb6upo59jtk59tvl.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3w4zpb6upo59jtk59tvl.gif" alt="Flexmonster Pivot Grid"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.flexmonster.com/?r=dv2" rel="noopener noreferrer"&gt;Flexmonster&lt;/a&gt; is a pivot table component that is written in JavaScript. It’s suitable for web reporting and analysis of tabular and multidimensional data. &lt;/p&gt;

&lt;p&gt;Its main advantage is compatibility with various client-side technologies including Angular and AngularJS.&lt;/p&gt;

&lt;p&gt;To get started, you need to choose the type of data source that is used in your application. The most common one is an &lt;strong&gt;SQL/NoSQL&lt;/strong&gt; database but &lt;strong&gt;JSON&lt;/strong&gt;, &lt;strong&gt;CSV&lt;/strong&gt; sources, and &lt;strong&gt;OLAP&lt;/strong&gt; cubes are supported equally. &lt;/p&gt;

&lt;p&gt;As soon as you’ve embedded Flexmonster into your project and loaded the data into it, you can make use of all the built-in features to start configuring your own interactive report. After all, the report can be exported to Excel, PDF, Image, and HTML.&lt;/p&gt;

&lt;p&gt;Nextly, I’d like to outline the list of analytical features which came in handy for my reporting purposes.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Analytical features&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Aggregation functions (i.e. 16 built-in functions and the ability to create custom ones)&lt;/li&gt;
&lt;li&gt;Organizing the data is possible using sorting, grouping and filtering features&lt;/li&gt;
&lt;li&gt;The drag-and-drop feature&lt;/li&gt;
&lt;li&gt;Slicing &amp;amp; dicing&lt;/li&gt;
&lt;li&gt;Embedded pivot charts.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;How to integrate a pivot table with Angular&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Personally, I find the whole process as simple as copy-paste. Here’s a &lt;a href="https://www.flexmonster.com/doc/integration-with-angular/?r=dv2" rel="noopener noreferrer"&gt;tutorial&lt;/a&gt; which helped me to get started.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Dashboards &amp;amp; data visualization&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If you, your users or teammates need not only aggregate the data but also visualize it, an excellent idea is to build an interactive dashboard inside the app or give an ability to do so. Many analysts are fond of dashboards since they help in tracking business metrics and making data-driven decisions. And, as a developer, you may know that it takes a lot of time to build and configure it upon the ad-hoc or recurring requests. &lt;/p&gt;

&lt;p&gt;Let’s consider the second tool that will save you time and help your web project stand out with an interactive data visualization.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Google Charts&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Froixcwognm9w7c9iycfx.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Froixcwognm9w7c9iycfx.gif" alt="Stacked Column Chart"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s hard to find a better charting web service in a segment of free software than &lt;strong&gt;Google Charts&lt;/strong&gt;. &lt;br&gt;
It removes the necessity in manipulating DOM elements with D3.js: Google Charts provides extensive APIs for generating charts based on the data. All you need to enliven your data is to include the Google Loader into a web page, create a DataTable JavaScript object, then asynchronously pass the data to it and define a function that instantiates and draws the chart.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;How to load data in charts&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The easiest way to pull the data from your application and send it to the charts is to use a web service called Datasource or Flexmonster Pivot Table. The former supports the Chart Tools Datasource protocol and allows sending an SQL query to a Datasource for retrieving a DataTable instance filled with data. The latter can serve as a client-side provider of aggregated data from various data sources. Using it, you don’t need to write queries to retrieve the data from the pivot grid - just call the appropriate API methods for it. Besides, this component offers JavaScript connectors which eliminate the need to write a code of data processing for some basic chart types. But, of course, you can do it if you need to implement some custom logic.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Google Charts in Angular app&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Google Charts is compatible with Angular as well - I’ve managed to find a wrapper for it on npm. &lt;/p&gt;

&lt;p&gt;This is how a &lt;strong&gt;dashboard&lt;/strong&gt; with Flexmonster and Google Charts can look like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp1ay2e8n9voe8z1con7e.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp1ay2e8n9voe8z1con7e.PNG" alt="Stacked Column Chart"&gt;&lt;/a&gt;&lt;br&gt;
As you see, charts and tables are not in opposition to each other. On the contrary, they shine together when combined. A dashboard has the potential to enhance the communication of the analysis results. &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Summary&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Today I’ve tried to analyze the benefits of Angular as a platform for building the dynamic web applications. However, one should be aware that Angular can simplify the development process as well as complicate it. Think thoroughly whether your particular project needs this framework or not.&lt;/p&gt;

&lt;p&gt;Looking forward to hearing your feedback and suggestions.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Useful links&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;These guides helped me to walk through the process of integration with Flexmonster and Google Charts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://y0rxj9vz29.codesandbox.io/" rel="noopener noreferrer"&gt;A sample of Angular project with Flexmonster and Google Charts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feel free to fork it and play with your data :) &lt;br&gt;
&lt;a href="https://codesandbox.io/s/y0rxj9vz29?fontsize=14" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcodesandbox.io%2Fstatic%2Fimg%2Fplay-codesandbox.svg" alt="Edit Flexmonster Angular"&gt;&lt;/a&gt; (I recommend opening a web page with a dashboard in a new tab/window as the embedded browser in this IDE doesn't always show the results correctly)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.flexmonster.com/doc/integration-with-angular/?r=dv2" rel="noopener noreferrer"&gt;Tutorial about the integration of Flexmonster and Angular&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/chart/interactive/docs/gallery/?r=dv2" rel="noopener noreferrer"&gt;Google Charts gallery&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/angular-google-charts/?r=dv2" rel="noopener noreferrer"&gt;A wrapper of Google Charts for Angular 6 &amp;amp; 7&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>typescript</category>
      <category>angular</category>
    </item>
  </channel>
</rss>
