The foundation of every dashboard is its layout. These can range from simple layouts with a single chart to much more complex layouts with many nested rows and columns and many different-sized charts, or even other components such as filters. When we create a dashboard, we usually define the layout before we define data sources or chart components. Without a layout, where would we place our charts? This recipe teaches you to create a simple layout using a responsive web framework called bootstrap.
To get ready for this recipe, you first need to start the MongoDB server with the same database as that of the last chapter. You will also have to start the Pentaho BA Server using the server control scripts. Once it is started, you can log in to the BI Server.
In this recipe, we are going to create a new dashboard and design a simple 2x2 layout. This layout will allow us to add a total of four components to the dashboard, be it charts, filters, or whatever:
bootstrap
, as shown here:Now that we have saved our dashboard, we are going to open it in render mode to see what it looks like:
You can see that we have created a simple two-column layout. We could technically start adding dashboard components such as charts and filters to these two areas. But, let's go back to the original dashboard we were editing and add some more layout.
Now it's time to refresh the dashboard in render mode to see our latest changes.
You will now see a simple 2x2 layout with four main panels, like this:
To finish off, we will add a simple HTML component to the top-left layout column.
<h2 style="margin-top:0px">My Dashboard</h2>
Layout Structure
window:Let's refresh our latest changes on the dashboard:
You can see that we have added some basic HTML to our dashboard, as follows:
In this recipe, we showed you how to create a new dashboard and define a layout of rows and nested columns. It's possible to nest further rows into columns and more columns into those rows. It is even possible to set the size of columns that add up to a total value of 12 based on the bootstrap framework. To create a 50 on 50 layout, we set each column to a width of 6
. We could have also created a layout with four columns, each having a width of 3
.
Plus, we were able to add some basic HTML to our layout. The ability to add HTML to our layout opens the door to all sorts of possibilities in dashboard layout design.
Basically, by using the bootstrap framework, CDE, and some imagination, it is possible create bespoke responsive dashboards that will fit in different screens types, such as desktops, tablets, or mobile phones.