Pentaho Tools :

Pentaho C-Tools(CDE,CDF,CDA),Pentaho CE & EE Server,OLAP-Cubes,Analysis using Pivot4J, Saiku Analytics, Saiku Reporting, Ad-hoc Reporting using Interactive Reporting Tool,Dashboards,Reports using PRD, PDD,Data Integration using Kettle ETL,Data Mining usign WEKA,Integration of Servers with Databases,Mobile/iPad compatible Dashboards using Bootstrap Css,Drilldown dashboards,Interactive Dashboards

Friday, 23 May 2014

Mobile Dashboard Example in Pentaho : Highly Interactive Dashboard example in Pentaho CDE using Bootstrap Css - Sales Dashboard Example 3

Highly Interactive Dashboard example in Pentaho CDE using Bootstrap Css.

Give a gift to your client with open source technologies 

All the concepts are taken from pentaho forum threads and from my R&.


Special thanks to Pentaho & to the team for this awesome tool. Thank you to Pedro, duarte.leao and  lukolap for actively giving hits and for your encouragement to learn the tips and tricks.


This is an example covered with essential features on the dashboard. As it is a demonstration example, there might be few known issues but I believe this will give at least some idea to the readers of this post. 


Example developed and published date :
May 23rd 2014
Updated on 26th May 2014

Software set up : 
CDE,CDA,CDF Trunk (after 14. 05.06) , Pentaho 5.0.1 Stable CE, foodmart database of Postgres. (database comes along with jasperserver example database for postgres)

This post will cover the below stuff .
1. Charts Communication (Inter frame/charts communication by passing category name).
2. Drill down from 1 dashboard to another dashboard.
3. Relatively adjusting the chart heights and widths using bootstrap css & java script.


4. Drill back to Parent dashboard by providing a link or button on 2nd dashboard.
5. Table component formatting – Removing row banding.
6. Horizontal scroll down for table component if there are more columns to show on the dashboard.
6. Majorly Bootstrap Penel: 
How to divide a single panel to place 3 charts using bootstrap HTML code. 
7.Changing the color of bars as the same color of slice(related to point -1)


The first 3 points are already covered in my previous example post.
You can refer  previous dashboard examples here with source code availability

End User Benefits :
1) Fast access of data on the dashboard -  using Pentaho cache mechanism.
2) Awesome look and feel of the charts – using protovis charts
3) Mobile/iPad/laptop/desktop comparability of the dashboard – Using bootstrap css.
4) High interactivity on the dashboard.
     a) tool tip & legends
     b) No drill down to the next level but get reflecting in the same dashboard page.
     c) 1 level of drill down to the child dashboard. 


1) CDE Dashboard Example using bootstrap css - Sales Dashboard 2
http://pentaho-bi-suite.blogspot.in/2014/04/bootstrap-example-in-pentaho-cde.html

2) CDE dashboard example - Sales Dashboard 1
http://pentaho-bi-suite.blogspot.in/2013/12/pentaho-cde-dashboard-complete-example.html

Source code of the present example : Sales Dashboard 3
Download the example by clicking below link 
https://drive.google.com/folderview?id=0BymV_QP4TGBEaVlYVjBSQk9abVk&usp=sharing


Images of the current Example:

Parent Dashboard :
Drill down dashboard :

NOTE :
For drill down dashboard, you need to change the port number in click action of 3rd chart (pie chart) [I have used 8085 port number]


What is updated on May 26th 2014 on the same example :
Point 7 is done .
In detail :

for example, Assume you have doughnut(formally pie chart) having 5 different colors and this chart is associated with a bar chart.

In simple terms as shown in below images on clicking on slice of pie chart the colors of the bars also should pick the same color(by default the bars do not pick the same color, either it pick a same default color (blue) or if you set color role=category  in the properties it will display all different colors).





To achieve the above you need to do the below

Parameter :
Create a parameter called "param3_color"
On pie chart :
set click-able as True
In the click action catch the color of slice in the created parameter.
the bold part of the code will do this job, the rest of the code for some other purpose in the dashboard.

function f(wedge) {
   
    Dashboards.fireChange('param1_ProductType', wedge.vars.category.value);
    //alert("you have clicked on"+" "+param1_ProductType);
   
    var color = this.pvMark.fillStyle();
    Dashboards.fireChange('param3_color',color.color);

   // alert(color.color);
  //  alert("Slice color code picked in parameter : "+param3_color);

}

On bar chart :
In the postFectch function write below code.
That means after fetching all color code you are applying that color code to the bars.

 function fun(){
 var selectedColor = Dashboards.getParameterValue("param3_color");
    if(selectedColor) {
        this.chartDefinition.colors = [selectedColor];
    }
 }




References :
1)http://forums.pentaho.com/showthread.php163345-Pass-pie-chart-slice-color-to-other-chart
2) https://interestingittips.wordpress.com/category/pentaho/page/2/
3) http://forums.pentaho.com/showthread.php?163032-Table-Component

4) http://forums.pentaho.com/showthread.php?163345-Pass-pie-chart-slice-color-to-other-chart&p=375976#post375976


Improve this dashboard by commenting - Suggestions & features add-ins are welcome to this example.

Sadakar
BI developer