Commit 0d76b3bb authored by dkasliwal's avatar dkasliwal

Changes in GraphComponent.java and SmartFiltrCreator file

DOM.createUniqueId is append to chartcontainer Div
getDisplayDate method add uniqueId Parameter.
SmartFiltrCreator method add uniqueId Parameter.
In buildchart.js file all container append on body tag.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99215 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3ae70420
......@@ -21,6 +21,7 @@ import com.google.gwt.http.client.Response;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
......@@ -44,7 +45,6 @@ import com.google.gwt.user.client.ui.VerticalPanel;
public class GraphComponent extends Composite
{
/** The chartcontainer hold the FusionChart */
private VerticalPanel mainContainer = new VerticalPanel();
private SimplePanel gridContainer = new SimplePanel();
private JSONObject jsonObjMetaData = new JSONObject();
......@@ -112,7 +112,10 @@ public class GraphComponent extends Composite
}
@SuppressWarnings("unchecked")
public void buildChart(final LinkedHashMap<String, JSONObject> dataMap,ArrayList<String> parameterList,ArrayList<FilterInfo> filterList)
{
{
/*Start Add uniqueId for random Id by Dhanendra on 09-11-2015*/
String uniqueId = DOM.createUniqueId();
/*End Add uniqueId for random Id by Dhanendra on 09-11-2015*/
JSONObject jsonObjFrGraph = null;
String height = null;
String width = null;
......@@ -186,7 +189,6 @@ public class GraphComponent extends Composite
/*Add Veriable by Dhanendra on 20-10-2015*/
/** End Code By Dhanendra for No Data Found Msg **/
if (idList.size() > 0)
{
for (int i = 0; i < idList.size(); i++)
......@@ -195,20 +197,22 @@ public class GraphComponent extends Composite
//RootPanel panel = RootPanel.get("chartContainer" + idList.get(i));
/*comment line because of container name change by Dhanedra 01-07-15*/
RootPanel panel = RootPanel.get(idList.get(i));
panel.clear();
if (panel.getElement().getFirstChild() != null)
{
//panel.getElement().getFirstChild().removeFromParent();
panel.getElement().removeFromParent();
}
/*if(panel!=null)
{*/
panel.clear();
if (panel.getElement().getFirstChild() != null)
{
//panel.getElement().getFirstChild().removeFromParent();
panel.getElement().removeFromParent();
}
/*}*/
}
idList = new ArrayList<String>();
}
/*if(dataMap.toString().length()>20) //if loop for no data found alert
{*/ // for only OTC
{*/ // for only OTC
for (String componentId : gridNGraphMeataDataMap.keySet())
{
jsonObjFrGraph=new JSONObject();
if(isNumeric(componentId))
{
......@@ -225,6 +229,7 @@ public class GraphComponent extends Composite
graphTypeMap = gridNGraphMeataDataMap.get("type"+componentId);
String type = ""+(graphTypeMap.get("type"+componentId));
if("T".equalsIgnoreCase(type))
{
componentTypeMap = gridNGraphMeataDataMap.get(compType);
......@@ -280,40 +285,55 @@ public class GraphComponent extends Composite
rawDataMapJsonOuter = new JSONObject();
fltrDataJson = new JSONObject();
dataJsn = (JSONObject) jsonObjFrGraph.get(dtSrouce);
mainDataJsn = new JSONObject();
mainDataJsn.put("1", dataJsn);
if(componentId.equals("1"))
if(jsonObjFrGraph != null)
{
rawDataMapJsonOuter = getDataMapJson(dataJsn, groupNameList.get(0),graphDtlList);
grpNameList.add(groupNameList.get(0));
}else{
if(jsonAftrFltr.size() == 0)
dataJsn = (JSONObject) jsonObjFrGraph.get(dtSrouce);
mainDataJsn = new JSONObject();
mainDataJsn.put("1", dataJsn);
if(componentId.equals("1"))
{
fltrDataJson = getFltrDataJson(dataJsn, grpNameList.get(0),null);
/*Added code by dhanendra for get first Name to display on date 21-10-2015*/
firstNameforTitle = ""+ fltrDataJson.get("0");
fltrDataJson = (JSONObject) fltrDataJson.get("1");
/*Added code by dhanendra for get first Name to display on date 21-10-2015*/
rawDataMapJsonOuter = getDataMapJson(dataJsn, groupNameList.get(0),graphDtlList);
grpNameList.add(groupNameList.get(0));
}else{
fltrDataJson = getFltrDataJson(jsonAftrFltr, grpNameList.get(0),null);
/*Added code by dhanendra for get first Name to display on date 21-10-2015*/
firstNameforTitle = ""+ fltrDataJson.get("0");
fltrDataJson = (JSONObject) fltrDataJson.get("1");
/*Added code by dhanendra for get first Name to display on date 21-10-2015*/
if(jsonAftrFltr.size() == 0)
{
fltrDataJson = getFltrDataJson(dataJsn, grpNameList.get(0),null);
/*Added code by dhanendra for get first Name to display on date 21-10-2015*/
firstNameforTitle = ""+ fltrDataJson.get("0");
fltrDataJson = (JSONObject) fltrDataJson.get("1");
/*Added code by dhanendra for get first Name to display on date 21-10-2015*/
}else{
fltrDataJson = getFltrDataJson(jsonAftrFltr, grpNameList.get(0),null);
/*Added code by dhanendra for get first Name to display on date 21-10-2015*/
firstNameforTitle = ""+ fltrDataJson.get("0");
fltrDataJson = (JSONObject) fltrDataJson.get("1");
/*Added code by dhanendra for get first Name to display on date 21-10-2015*/
}
rawDataMapJsonOuter = getDataMapJson(fltrDataJson, groupNameList.get(0),graphDtlList);
grpNameList = new ArrayList<String>();
grpNameList.add(groupNameList.get(0));
jsonAftrFltr = fltrDataJson;
}
if(rawDataMapJsonOuter.size() > 0)
{
/*Add uniqueId parameter in getDisplayData method to random component id by Dhanendra on Date 09-11-2015 */
getDisplayData(rawDataMapJsonOuter, graphDtlList, groupCssTypeNameList.get(0), width, height, imageName,refCompIdMap,mainDataJsn,groupNameList.get(0),filterList,firstNameforTitle,uniqueId);
}
rawDataMapJsonOuter = getDataMapJson(fltrDataJson, groupNameList.get(0),graphDtlList);
grpNameList = new ArrayList<String>();
grpNameList.add(groupNameList.get(0));
jsonAftrFltr = fltrDataJson;
}
if(rawDataMapJsonOuter.size() > 0)
{
getDisplayData(rawDataMapJsonOuter, graphDtlList, groupCssTypeNameList.get(0), width, height, imageName,refCompIdMap,mainDataJsn,groupNameList.get(0),filterList,firstNameforTitle);
else{
/*Add uniqueId to Graph,chartContainer by Dhanendra on Date 10-11-2015*/
this.createOuterDiv("Graph"+uniqueId+componentId,type,groupCssTypeNameList.get(0));
idList.add("Graph"+uniqueId+componentId+"Div");
this.createInnerDiv(uniqueId+componentId,"Graph"+componentId);
graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList);
this.createChart(graphJson.toString().replace('@', '='), uniqueId+componentId, "chartContainer" +uniqueId+ componentId, width, height, imageName,userMail,reportCaption);
/*End uniqueId to Graph,chartContainer by Dhanendra on Date 10-11-2015*/
}
}/*end Code for display Dashboard one by one in one page by Dhanendra*/
else
{
......@@ -326,9 +346,13 @@ public class GraphComponent extends Composite
// end- added empty json chartdata to display no data found message by swati on 7jan2015
if (graphJson != null && graphJson.size() > 0)
{
/*Added code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
this.createOuterDiv("Graph"+componentId,type,groupCssTypeNameList.get(0));
idList.add("Graph"+componentId+"Div");
/*Added code for Dynamic Div and New CSS By Dhanendra 01-07-15*/
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
this.createOuterDiv("Graph"+uniqueId+componentId,type,groupCssTypeNameList.get(0));
idList.add("Graph"+uniqueId+componentId+"Div");
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
Label componantTtl = new Label(componantTitlNameList.get(0));
Image componantTtlImg = new Image("FusionChart/images/"+componentIconName);
......@@ -357,17 +381,26 @@ public class GraphComponent extends Composite
mainPanel.add(dateHPanel);
mainPanel.setStyleName("mainPanel");
mainPanel.setCellHorizontalAlignment(dateHPanel, HasHorizontalAlignment.ALIGN_RIGHT);
RootPanel.get("Graph"+componentId+"head").add(mainPanel);
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
RootPanel.get("Graph"+uniqueId+componentId+"head").add(mainPanel);
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
// added code to add html tag to ssgrid by swati on 08-sep-2015
if(htmlString.length()>0)
{
htmlPnl = new HTMLPanel(htmlString);
RootPanel.get("Graph"+componentId).add(htmlPnl);
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
RootPanel.get("Graph"+uniqueId+componentId).add(htmlPnl);
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
}
// ended code to add html tag to ssgrid by swati on 08-sep-2015
this.createInnerDiv(Integer.parseInt(componentId),"Graph"+componentId);
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
this.createInnerDiv(uniqueId+componentId,"Graph"+uniqueId+componentId);
/*Ended code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
this.createChart(graphJson.toString().replace('@', '='), componentId, "chartContainer" + componentId, width, height, imageName,userMail,reportCaption);
this.createChart(graphJson.toString().replace('@', '='), uniqueId+componentId, "chartContainer" + uniqueId+componentId, width, height, imageName,userMail,reportCaption);
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
}
}
}
......@@ -402,8 +435,8 @@ public class GraphComponent extends Composite
scrlPanel.add(flexTable);
scrlPanel.setStyleName("flextableScrlPnl");
// RootPanel.get("chartContainergrid").add(scrlPanel);
RootPanel.get("chartContainer"+componentId).add(scrlPanel);
RootPanel.get("chartContainer"+componentId).add(horizontalPnl);
RootPanel.get("chartContainer"+uniqueId+componentId).add(scrlPanel);
RootPanel.get("chartContainer"+uniqueId+componentId).add(horizontalPnl);
} else if("DataGrid".equalsIgnoreCase(component))
{
......@@ -422,10 +455,14 @@ public class GraphComponent extends Composite
gridTitleLbl.setStyleName("componantTtl");
gridTtlPanel.add(gridTtlImg);
gridTtlPanel.add(gridTitleLbl);
this.createOuterDiv("Grid"+componentId,type,gridCssName);
idList.add("Grid"+componentId+"Div");
RootPanel.get("Grid"+componentId+"head").add(gridTtlPanel);
RootPanel.get("Grid"+componentId+"Div").add(flexTable);
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
this.createOuterDiv("Grid"+uniqueId+componentId,type,gridCssName);
idList.add("Grid"+uniqueId+componentId+"Div");
RootPanel.get("Grid"+uniqueId+componentId+"head").add(gridTtlPanel);
RootPanel.get("Grid"+uniqueId+componentId+"Div").add(flexTable);
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
/*Ended code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
/*RootPanel.get("chartContainer"+componentId).clear();
......@@ -451,8 +488,12 @@ public class GraphComponent extends Composite
}
filtrGridJSN.put(dtSrouce, dataJsn);
flexTable = data.jsonToArrayList(dataDtl.getGridNMapMetData(jsonObjMetaData,parameterList.get(parameterList.size()-1),parameterList), filtrGridJSN,dtSrouce,componentId,parameterList, filterList,firstIndex);
this.createOuterDiv(gridGroupName+"Grid",type,null);
idList.add(gridGroupName+"GridDiv");
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
this.createOuterDiv(gridGroupName+uniqueId+"Grid",type,null);
idList.add(gridGroupName+uniqueId+"GridDiv");
/*End uniqueId to Grid by Dhanendra on date 10-11-2015*/
Image gridTtlImg = new Image("FusionChart/images/"+gridIconName);
HorizontalPanel gridTtlPanel = new HorizontalPanel();
gridTitleLbl = new Label(firstIndex);
......@@ -460,8 +501,12 @@ public class GraphComponent extends Composite
gridTitleLbl.setStyleName("componantTtl");
gridTtlPanel.add(gridTtlImg);
gridTtlPanel.add(gridTitleLbl);
RootPanel.get(gridGroupName+"Gridhead").add(gridTtlPanel);
RootPanel.get(gridGroupName+"GridDiv").add(flexTable);
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
RootPanel.get(gridGroupName+uniqueId+"Gridhead").add(gridTtlPanel);
RootPanel.get(gridGroupName+uniqueId+"GridDiv").add(flexTable);
/*End uniqueId to Grid by Dhanendra on date 10-11-2015*/
}
/*Add code check condition for gridGroupName present in metadata*/
}
......@@ -493,10 +538,14 @@ public class GraphComponent extends Composite
/*Added code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
gridTitleLbl = new Label(gridComponantTitleName);
this.createOuterDiv("Grid"+componentId,type,gridCssName);
idList.add("Grid"+componentId+"Div");
RootPanel.get("Grid"+componentId+"head").add(gridTitleLbl);
RootPanel.get("Grid"+componentId+"Div").add(flexTable);
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
this.createOuterDiv("Grid"+uniqueId+componentId,type,gridCssName);
idList.add("Grid"+uniqueId+componentId+"Div");
RootPanel.get("Grid"+uniqueId+componentId+"head").add(gridTitleLbl);
RootPanel.get("Grid"+uniqueId+componentId+"Div").add(flexTable);
/*End uniqueId to Grid by Dhanendra on date 10-11-2015*/
/*Ended code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
/*RootPanel.get("chartContainer"+componentId).add(flexTable);*/
......@@ -584,10 +633,14 @@ public class GraphComponent extends Composite
gridTitleLbl.setStyleName("componantTtl");
gridTtlPanel.add(gridTtlImg);
gridTtlPanel.add(gridTitleLbl);
this.createOuterDiv("Card"+componentId,type,gridCssName);
idList.add("Card"+componentId+"Div");
RootPanel.get("Card"+componentId+"head").add(gridTtlPanel);
RootPanel.get("Card"+componentId+"Div").add(panel);
/*Add uniqueId to Card by Dhanendra on date 10-11-2015*/
this.createOuterDiv("Card"+uniqueId+componentId,type,gridCssName);
idList.add("Card"+uniqueId+componentId+"Div");
RootPanel.get("Card"+uniqueId+componentId+"head").add(gridTtlPanel);
RootPanel.get("Card"+uniqueId+componentId+"Div").add(panel);
/*End uniqueId to Card by Dhanendra on date 10-11-2015*/
/*Ended code for Dyanamic Div and New CSS By Dhanendra 13-07-15*/
......@@ -645,9 +698,9 @@ public class GraphComponent extends Composite
}
if (graphJson != null && graphJson.size() > 0)
{
this.createOuterDiv("Gantt" + componentId, type, gridCssName);
idList.add("Gantt"+componentId+"Div");
this.createGnttChart(graphJson.toString(), "Gantt"+componentId +"Div", height, width);
this.createOuterDiv("Gantt" +uniqueId+ componentId, type, gridCssName);
idList.add("Gantt"+uniqueId+componentId+"Div");
this.createGnttChart(graphJson.toString(), "Gantt"+uniqueId+componentId +"Div", height, width);
}
}
}
......@@ -682,9 +735,9 @@ public class GraphComponent extends Composite
}
if (graphJson != null && graphJson.size() > 0)
{
this.createOuterDiv("Gauge"+componentId, type, gridCssName);
idList.add("Gauge"+componentId+"Div");
this.createGaugeChart(graphJson.toString(), "Gauge"+componentId+"Div");
this.createOuterDiv("Gauge"+uniqueId+componentId, type, gridCssName);
idList.add("Gauge"+uniqueId+componentId+"Div");
this.createGaugeChart(graphJson.toString(), "Gauge"+uniqueId+componentId+"Div");
}
}
}
......@@ -711,10 +764,14 @@ public class GraphComponent extends Composite
/*added new method for smart filter by sachin 12 may 2015*/
/*Add IdList Parameter to buildchart method by dhanendra on date 23-11-2015*/
@SuppressWarnings("unchecked")
public void buildChart(final LinkedHashMap<String, JSONObject> dataMap ,HashMap<String, HashMap> gridNGraphMeataDataMap,ArrayList<FilterInfo> filterList)
public void buildChart(final LinkedHashMap<String, JSONObject> dataMap ,HashMap<String, HashMap> gridNGraphMeataDataMap,ArrayList<FilterInfo> filterList,ArrayList<String> idListTemp)
{
/*Start Add uniqueId for random Id by Dhanendra on 19-11-2015*/
String uniqueId = DOM.createUniqueId();
/*End Add uniqueId for random Id by Dhanendra on 19-11-2015*/
JSONObject jsonObjFrGraph = null;
String height = null;
String width = null;
......@@ -762,7 +819,9 @@ public class GraphComponent extends Composite
/*Ended By Dhanendra on 25May2015 for Group*/
/*add for heading for SS Grid*/
ArrayList<String> headingOfSSGridList = null;
//ArrayList<String> headingOfSSGridList = null;
String htmlString="";
HTMLPanel htmlPnl=null;
/*End for heading for SS Grid*/
/** Add Code By Dhanendra for No Data Found Msg **/
......@@ -806,7 +865,46 @@ public class GraphComponent extends Composite
/*
* if(dataMap.toString().length()>20) //if loop for no data found alert
* {
*/// for only OTC
*/// for only OTC
/*Add code Initialisation and clear container Idlist by dhanendra on date 23-11-2015*/
if(idList.size()>0)
{
idListTemp = new ArrayList<String>();
}
if (idListTemp.size() > 0)
{
for (int i = 0; i < idListTemp.size(); i++)
{
RootPanel panel = RootPanel.get(idListTemp.get(i));
panel.clear();
if (panel.getElement().getFirstChild() != null)
{
panel.getElement().removeFromParent();
}
}
idListTemp = new ArrayList<String>();
}
/*End code Initialisation Idlist by dhanendra on date 23-11-2015*/
if (idList.size() > 0)
{
for (int i = 0; i < idList.size(); i++)
{
/*comment line because of container name change by Dhanedra 01-07-15*/
//RootPanel panel = RootPanel.get("chartContainer" + idList.get(i));
/*comment line because of container name change by Dhanedra 01-07-15*/
RootPanel panel = RootPanel.get(idList.get(i));
panel.clear();
if (panel.getElement().getFirstChild() != null)
{
//panel.getElement().getFirstChild().removeFromParent();
panel.getElement().removeFromParent();
}
}
idList = new ArrayList<String>();
}
for (String componentId : gridNGraphMeataDataMap.keySet())
{
jsonObjFrGraph = new JSONObject();
......@@ -850,7 +948,7 @@ public class GraphComponent extends Composite
/*
* String abc=
* "{'0':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-5000', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00058 ', 'due_date':'12/02/15', 'tot_amt':'-5000', 'curr_code':'USD '}, '1':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-2748.77', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00052 ', 'due_date':'12/02/15', 'tot_amt':'-2748.77', 'curr_code':'USD '}, '2':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-2748.77', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00054 ', 'due_date':'12/02/15', 'tot_amt':'-2748.77', 'curr_code':'USD '}, '3':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-60', 'ref_date':'28/04/15', 'site_code':'TA821', 'exch_rate':'2.5', 'ref_no':'718IR00207 ', 'due_date':'28/04/15', 'tot_amt':'-60', 'curr_code':'RS '}, '4':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-2748.77', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00056 ', 'due_date':'12/02/15', 'tot_amt':'-2748.77', 'curr_code':'USD '}, '5':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-5000', 'ref_date':'13/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00059 ', 'due_date':'13/02/15', 'tot_amt':'-5000', 'curr_code':'USD '}, '6':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-10000', 'ref_date':'13/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00060 ', 'due_date':'13/02/15', 'tot_amt':'-10000', 'curr_code':'USD '}, '7':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-780', 'ref_date':'14/04/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00177 ', 'due_date':'14/04/15', 'tot_amt':'-780', 'curr_code':'USD '}, '8':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-10', 'ref_date':'13/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00067 ', 'due_date':'13/02/15', 'tot_amt':'-10', 'curr_code':'USD '}, '9':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-20', 'ref_date':'18/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00091 ', 'due_date':'18/02/15', 'tot_amt':'-20', 'curr_code':'USD '}, '10':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-2748.77', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00057 ', 'due_date':'12/02/15', 'tot_amt':'-2748.77', 'curr_code':'USD '}, '11':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-10', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00055 ', 'due_date':'12/02/15', 'tot_amt':'-10', 'curr_code':'USD '}}"
* "{'0':{'tran_ser':'R-ADV', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-5000', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00058 ', 'due_date':'12/02/15', 'tot_amt':'-5000', 'curr_code':'USD '}, '1':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-2748.77', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00052 ', 'due_date':'12/02/15', 'tot_amt':'-2748.77', 'curr_code':'USD '}, '2':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-2748.77', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00054 ', 'due_date':'12/02/15', 'tot_amt':'-2748.77', 'curr_code':'USD '}, '3':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-60', 'ref_date':'28/04/15', 'site_code':'TA821', 'exch_rate':'2.5', 'ref_no':'718IR00207 ', 'due_date':'28/04/15', 'tot_amt':'-60', 'curr_code':'RS '}, '4':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-2748.77', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00056 ', 'due_date':'12/02/15', 'tot_amt':'-2748.77', 'curr_code':'USD '}, '5':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-5000', 'ref_date':'13/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00059 ', 'due_date':'13/02/15', 'tot_amt':'-5000', 'curr_code':'USD '}, '6':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-10000', 'ref_date':'13/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00060 ', 'due_date':'13/02/15', 'tot_amt':'-10000', 'curr_code':'USD '}, '7':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-780', 'ref_date':'14/04/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00177 ', 'due_date':'14/04/15', 'tot_amt':'-780', 'curr_code':'USD '}, '8':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-10', 'ref_date':'13/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00067 ', 'due_date':'13/02/15', 'tot_amt':'-10', 'curr_code':'USD '}, '9':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-20', 'ref_date':'18/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00091 ', 'due_date':'18/02/15', 'tot_amt':'-20', 'curr_code':'USD '}, '10':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-2748.77', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00057 ', 'due_date':'12/02/15', 'tot_amt':'-2748.77', 'curr_code':'USD '}, '11':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-10', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00055 ', 'due_date':'12/02/15', 'tot_amt':'-10', 'curr_code':'USD '}}"
* ;
*
* JSONValue jsonValue=new JSONString(abc); JSONObject
......@@ -878,7 +976,12 @@ public class GraphComponent extends Composite
componantTitlNameList =(ArrayList<String>)graphDtlList.get(18);
groupCssTypeNameList =(ArrayList<String>)graphDtlList.get(19);
componentIconName = ""+graphDtlList.get(22);
headingOfSSGridList =(ArrayList<String>)graphDtlList.get(24);
//headingOfSSGridList =(ArrayList<String>)graphDtlList.get(24);
if(graphDtlList.get(24)!=null && graphDtlList.get(24).toString().length()>0)
{
htmlString =""+(graphDtlList.get(24));
}
if(groupNameList.size()>0)
{
refreshComponantIdList =(ArrayList<String>)graphDtlList.get(20);
......@@ -886,30 +989,44 @@ public class GraphComponent extends Composite
rawDataMapJsonOuter = new JSONObject();
fltrDataJson = new JSONObject();
dataJsn = (JSONObject) jsonObjFrGraph.get(dtSrouce);
mainDataJsn = new JSONObject();
mainDataJsn.put("1", dataJsn);
if(componentId.equals("1"))
if(jsonObjFrGraph != null)
{
rawDataMapJsonOuter = getDataMapJson(dataJsn, groupNameList.get(0),graphDtlList);
grpNameList.add(groupNameList.get(0));
}else{
if(jsonAftrFltr.size() == 0)
dataJsn = (JSONObject) jsonObjFrGraph.get(dtSrouce);
mainDataJsn = new JSONObject();
mainDataJsn.put("1", dataJsn);
if(componentId.equals("1"))
{
fltrDataJson = getFltrDataJson(dataJsn, grpNameList.get(0),null);
rawDataMapJsonOuter = getDataMapJson(dataJsn, groupNameList.get(0),graphDtlList);
grpNameList.add(groupNameList.get(0));
}else{
fltrDataJson = getFltrDataJson(jsonAftrFltr, grpNameList.get(0),null);
if(jsonAftrFltr.size() == 0)
{
fltrDataJson = getFltrDataJson(dataJsn, grpNameList.get(0),null);
}else{
fltrDataJson = getFltrDataJson(jsonAftrFltr, grpNameList.get(0),null);
}
rawDataMapJsonOuter = getDataMapJson(fltrDataJson, groupNameList.get(0),graphDtlList);
grpNameList = new ArrayList<String>();
grpNameList.add(groupNameList.get(0));
jsonAftrFltr = fltrDataJson;
}
if(rawDataMapJsonOuter.size() > 0)
{
/*Add uniqueId parameter in getDisplayData method to random component id by Dhanendra on Date 09-11-2015 */
getDisplayData(rawDataMapJsonOuter, graphDtlList, groupCssTypeNameList.get(0), width, height, imageName,refCompIdMap,mainDataJsn,groupNameList.get(0),filterList, firstNameforTitle,uniqueId);
}
rawDataMapJsonOuter = getDataMapJson(fltrDataJson, groupNameList.get(0),graphDtlList);
grpNameList = new ArrayList<String>();
grpNameList.add(groupNameList.get(0));
jsonAftrFltr = fltrDataJson;
}
if(rawDataMapJsonOuter.size() > 0)
{
getDisplayData(rawDataMapJsonOuter, graphDtlList, groupCssTypeNameList.get(0), width, height, imageName,refCompIdMap,mainDataJsn,groupNameList.get(0),filterList, firstNameforTitle);
else{
/*Add uniqueId to Graph,chartContainer by Dhanendra on Date 10-11-2015*/
this.createOuterDiv("Graph"+uniqueId+componentId,type,groupCssTypeNameList.get(0));
idList.add("Graph"+uniqueId+componentId+"Div");
this.createInnerDiv(uniqueId+componentId,"Graph"+componentId);
graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList);
this.createChart(graphJson.toString().replace('@', '='), uniqueId+componentId, "chartContainer" +uniqueId+ componentId, width, height, imageName,userMail,reportCaption);
/*End uniqueId to Graph,chartContainer by Dhanendra on Date 10-11-2015*/
}
}/*end Code for display Dashboard one by one in one page by Dhanendra*/
......@@ -925,8 +1042,12 @@ public class GraphComponent extends Composite
if (graphJson != null && graphJson.size() > 0)
{
/*Added code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
this.createOuterDiv("Graph"+componentId,type,groupCssTypeNameList.get(0));
idList.add("Graph"+componentId+"Div");
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
this.createOuterDiv("Graph"+uniqueId+componentId,type,groupCssTypeNameList.get(0));
idList.add("Graph"+uniqueId+componentId+"Div");
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
Label componantTtl = new Label(componantTitlNameList.get(0));
Image componantTtlImg = new Image("FusionChart/images/"+componentIconName);
......@@ -955,16 +1076,26 @@ public class GraphComponent extends Composite
mainPanel.add(dateHPanel);
mainPanel.setStyleName("mainPanel");
mainPanel.setCellHorizontalAlignment(dateHPanel, HasHorizontalAlignment.ALIGN_RIGHT);
RootPanel.get("Graph"+componentId+"head").add(mainPanel);
this.createInnerDiv(Integer.parseInt(componentId),"Graph"+componentId);
if(headingOfSSGridList.size()>0)
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
RootPanel.get("Graph"+uniqueId+componentId+"head").add(mainPanel);
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
// added code to add html tag to ssgrid by swati on 08-sep-2015
if(htmlString.length()>0)
{
HTMLPanel htmlPanel = new HTMLPanel(headingOfSSGridList.get(0));
RootPanel.get("chart"+componentId).add(htmlPanel);
htmlPnl = new HTMLPanel(htmlString);
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
RootPanel.get("Graph"+uniqueId+componentId).add(htmlPnl);
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
}
// ended code to add html tag to ssgrid by swati on 08-sep-2015
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
this.createInnerDiv(uniqueId+componentId,"Graph"+uniqueId+componentId);
/*Ended code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
this.createChart(graphJson.toString().replace('@', '='), componentId, "chartContainer" + componentId, width, height, imageName,userMail,reportCaption);
this.createChart(graphJson.toString().replace('@', '='), uniqueId+componentId, "chartContainer" + uniqueId+componentId, width, height, imageName,userMail,reportCaption);
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
}
}
}
......@@ -997,8 +1128,8 @@ public class GraphComponent extends Composite
scrlPanel.add(flexTable);
scrlPanel.setStyleName("flextableScrlPnl");
// RootPanel.get("chartContainergrid").add(scrlPanel);
RootPanel.get("chartContainer" + componentId).add(scrlPanel);
RootPanel.get("chartContainer" + componentId).add(horizontalPnl);
RootPanel.get("chartContainer"+uniqueId+componentId).add(scrlPanel);
RootPanel.get("chartContainer"+uniqueId+componentId).add(horizontalPnl);
} else if ("DataGrid".equalsIgnoreCase(component))
{
......@@ -1017,11 +1148,15 @@ public class GraphComponent extends Composite
gridTitleLbl.setStyleName("componantTtl");
gridTtlPanel.add(gridTtlImg);
gridTtlPanel.add(gridTitleLbl);
this.clearContainer("Grid"+componentId);
this.createOuterDiv("Grid"+componentId,type,gridCssName);
idList.add("Grid"+componentId+"Div");
RootPanel.get("Grid"+componentId+"head").add(gridTtlPanel);
RootPanel.get("Grid"+componentId+"Div").add(flexTable);
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
this.createOuterDiv("Grid"+uniqueId+componentId,type,gridCssName);
idList.add("Grid"+uniqueId+componentId+"Div");
RootPanel.get("Grid"+uniqueId+componentId+"head").add(gridTtlPanel);
RootPanel.get("Grid"+uniqueId+componentId+"Div").add(flexTable);
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
/*Ended code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
/*RootPanel.get("chartContainer"+componentId).clear();
......@@ -1047,8 +1182,12 @@ public class GraphComponent extends Composite
}
filtrGridJSN.put(dtSrouce, dataJsn);
flexTable = data.jsonToArrayList(dataDtl.getGridNMapMetData(jsonObjMetaData,parameterList.get(parameterList.size()-1),parameterList), filtrGridJSN,dtSrouce,componentId,parameterList, filterList,firstIndex);
this.createOuterDiv(gridGroupName+"Grid",type,null);
idList.add(gridGroupName+"GridDiv");
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
this.createOuterDiv(gridGroupName+uniqueId+"Grid",type,null);
idList.add(gridGroupName+uniqueId+"GridDiv");
/*End uniqueId to Grid by Dhanendra on date 10-11-2015*/
Image gridTtlImg = new Image("FusionChart/images/"+gridIconName);
HorizontalPanel gridTtlPanel = new HorizontalPanel();
gridTitleLbl = new Label(firstIndex);
......@@ -1056,8 +1195,12 @@ public class GraphComponent extends Composite
gridTitleLbl.setStyleName("componantTtl");
gridTtlPanel.add(gridTtlImg);
gridTtlPanel.add(gridTitleLbl);
RootPanel.get(gridGroupName+"Gridhead").add(gridTtlPanel);
RootPanel.get(gridGroupName+"GridDiv").add(flexTable);
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
RootPanel.get(gridGroupName+uniqueId+"Gridhead").add(gridTtlPanel);
RootPanel.get(gridGroupName+uniqueId+"GridDiv").add(flexTable);
/*End uniqueId to Grid by Dhanendra on date 10-11-2015*/
}
/*Add code check condition for gridGroupName present in metadata*/
}
......@@ -1093,11 +1236,14 @@ public class GraphComponent extends Composite
/*Added code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
gridTitleLbl = new Label(gridComponantTitleName);
this.clearContainer("Grid"+componentId);
this.createOuterDiv("Grid"+componentId,type,gridCssName);
idList.add("Grid"+componentId+"Div");
RootPanel.get("Grid"+componentId+"head").add(gridTitleLbl);
RootPanel.get("Grid"+componentId+"Div").add(flexTable);
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
this.createOuterDiv("Grid"+uniqueId+componentId,type,gridCssName);
idList.add("Grid"+uniqueId+componentId+"Div");
RootPanel.get("Grid"+uniqueId+componentId+"head").add(gridTitleLbl);
RootPanel.get("Grid"+uniqueId+componentId+"Div").add(flexTable);
/*End uniqueId to Grid by Dhanendra on date 10-11-2015*/
/*Ended code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
/*RootPanel.get("chartContainer"+componentId).add(flexTable);*/
......@@ -1156,6 +1302,57 @@ public class GraphComponent extends Composite
/** end of country map build method by swati 17 April 2015 **/
/**start of card build method by sachin 10 July 2015**/
if ("CARD".equalsIgnoreCase(type))
{
/*this.includeCSSfile("circle.css");
this.includeCSSfile("GwtDashboardPage.css");
this.includeJavascriptFile("FusionChart/js/BuildChart.js");
this.includeJavascriptFile("FusionChart/js/FusionCharts.js");
this.includeJavascriptFile("gwtdashboardreport/gwtdashboardreport.nocache.js");*/
for (String graphNo : graphDataMap.keySet())
{
//RootPanel.get("chartContainer"+componentId).clear();
graphDtlList = graphDataMap.get(graphNo);
SimplePanel panel = new CardBuilder().buildCard(graphDtlList, jsonObjFrGraph, dtSrouce);
//RootPanel.get("chartContainer"+componentId).add(panel);
/*Added code for Dyanamic Div and New CSS By Dhanendra 13-07-15*/
componantTitlNameList = new ArrayList<String>();
groupCssTypeNameList = new ArrayList<String>();
componantTitlNameList = (ArrayList<String>) graphDtlList.get(1);
groupCssTypeNameList = (ArrayList<String>) graphDtlList.get(2);
gridIconName = ""+graphDtlList.get(7);
Image gridTtlImg = new Image("FusionChart/images/"+gridIconName);
HorizontalPanel gridTtlPanel = new HorizontalPanel();
gridComponantTitleName = ""+componantTitlNameList.get(0);
gridCssName = ""+groupCssTypeNameList.get(0);
gridTitleLbl = new Label(gridComponantTitleName);
gridTtlImg.setStyleName("componantTtlImg");
gridTitleLbl.setStyleName("componantTtl");
gridTtlPanel.add(gridTtlImg);
gridTtlPanel.add(gridTitleLbl);
/*Add uniqueId to Card by Dhanendra on date 10-11-2015*/
this.createOuterDiv("Card"+uniqueId+componentId,type,gridCssName);
idList.add("Card"+uniqueId+componentId+"Div");
RootPanel.get("Card"+uniqueId+componentId+"head").add(gridTtlPanel);
RootPanel.get("Card"+uniqueId+componentId+"Div").add(panel);
/*End uniqueId to Card by Dhanendra on date 10-11-2015*/
/*Ended code for Dyanamic Div and New CSS By Dhanendra 13-07-15*/
/*
* imageName = (String) graphDtlList.get(0); width =
* (String) graphDtlList.get(1); height = (String)
* graphDtlList.get(2);
*/
}
}
/**end of card build method by sachin 10 July 2015**/
/** Star Code for Building ganttChart by sachin 5 Aug 2015 **/
......@@ -1202,9 +1399,9 @@ public class GraphComponent extends Composite
}
if (graphJson != null && graphJson.size() > 0)
{
this.createOuterDiv("Gantt" + componentId, type, gridCssName);
idList.add("Gantt"+componentId+"Div");
this.createGnttChart(graphJson.toString(), "Gantt"+componentId +"Div", height, width);
this.createOuterDiv("Gantt" +uniqueId+ componentId, type, gridCssName);
idList.add("Gantt"+uniqueId+componentId+"Div");
this.createGnttChart(graphJson.toString(), "Gantt"+uniqueId+componentId +"Div", height, width);
}
}
}
......@@ -1239,9 +1436,9 @@ public class GraphComponent extends Composite
}
if (graphJson != null && graphJson.size() > 0)
{
this.createOuterDiv("Gauge"+componentId, type, gridCssName);
idList.add("Gauge"+componentId+"Div");
this.createGaugeChart(graphJson.toString(), "Gauge"+componentId+"Div");
this.createOuterDiv("Gauge"+uniqueId+componentId, type, gridCssName);
idList.add("Gauge"+uniqueId+componentId+"Div");
this.createGaugeChart(graphJson.toString(), "Gauge"+uniqueId+componentId+"Div");
}
}
}
......@@ -1298,7 +1495,7 @@ public class GraphComponent extends Composite
alert("Excpeiton :: GraphComponent : createOuterDiv [" + e.message + "]");
}
}-*/;
private native void createInnerDiv(int innerDivId, String groupName)
private native void createInnerDiv(String innerDivId, String groupName)
/*-{
try {
$wnd.innerDiv(innerDivId,groupName);
......@@ -1438,7 +1635,8 @@ public class GraphComponent extends Composite
{
buildChart(componentDataMap,parameterList,filterList);
/*added by sachin for smart filter 12 may 2015*/
mainContainer.add(new SmartFiltrCreator(datsSourceDtlMap, componentDataMap, jsonObjMetaData, parameterList,filterList));
/*Add idList Parameter in SmartFiltrCreator method by Dhanendra on Date 23-11-2015*/
mainContainer.add(new SmartFiltrCreator(datsSourceDtlMap, componentDataMap, jsonObjMetaData, parameterList,filterList,idList));
/*ended by sachin for smart filter 12 may 2015*/
}
} else
......@@ -1614,7 +1812,8 @@ public class GraphComponent extends Composite
}
@SuppressWarnings("unchecked")
private void getOnClickFltrDataJson(JSONObject mainDataJson, String groupNameVal, HashMap<String, String>refrshMapVal,String groupCssTypeName, String width, String height, String imageName,ArrayList<FilterInfo> filterList)
/*Add uniqueId parameter to getOnClickFltrDataJson method by Dhanendra on date 10-11-2015*/
private void getOnClickFltrDataJson(JSONObject mainDataJson, String groupNameVal, HashMap<String, String>refrshMapVal,String groupCssTypeName, String width, String height, String imageName,ArrayList<FilterInfo> filterList, String uniqueId)
{
e12LoadImg.setLoadingInfo("Waiting For Data...");
e12LoadImg.setLoading(true);
......@@ -1701,9 +1900,12 @@ public class GraphComponent extends Composite
break;
}
getClearDiv(groupName);
getDisplayData(fltrAfterDataJson, graphDtlList, groupCssList.get(0), width, height, imageName, refrshMapVal, mainDataJson,groupName,filterList, firstNameforTitle);
/*Add uniqueId to groupName and add uniqueId parameter to getDisplayData by Dhanendra On Date 10-11-2015*/
getClearDiv(groupName+uniqueId);
getDisplayData(fltrAfterDataJson, graphDtlList, groupCssList.get(0), width, height, imageName, refrshMapVal, mainDataJson,groupName,filterList, firstNameforTitle,uniqueId);
/*End uniqueId to groupName and add uniqueId parameter to getDisplayData by Dhanendra On Date 10-11-2015*/
}
}else if ("T".equalsIgnoreCase(type))
......@@ -1729,11 +1931,14 @@ public class GraphComponent extends Composite
filtrGridJSN = new JSONObject();
filtrGridJSN.put("1", dataJson);
flexTable = data.jsonToArrayList(dataDtl.getGridNMapMetData(jsonObjMetaData,parameterList.get(parameterList.size()-1),parameterList), filtrGridJSN,"1",""+compId,parameterList, filterList,firstIndex);
this.clearContainer(groupName+"Grid");
this.createOuterDiv(groupName+"Grid",type,null);
idList.add(groupName+"GridDiv");
RootPanel.get(gridGroupName+"Gridhead").add(gridLblVal);
RootPanel.get(groupName+"GridDiv").add(flexTable);
/*Add uniqueId to groupName by Dhanendra on date 10-11-2015*/
this.clearContainer(groupName+uniqueId+"Grid");
this.createOuterDiv(groupName+uniqueId+"Grid",type,null);
idList.add(groupName+uniqueId+"GridDiv");
RootPanel.get(gridGroupName+uniqueId+"Gridhead").add(gridLblVal);
RootPanel.get(groupName+uniqueId+"GridDiv").add(flexTable);
/*End uniqueId to groupName by Dhanendra on date 10-11-2015*/
}
}
}
......@@ -1745,7 +1950,8 @@ public class GraphComponent extends Composite
this.clearContainer(groupName);
}
/*Add firstNameforTitle parameter by Dhanendra on date 21-10-2015*/
private void getDisplayData(final JSONObject mainDataJson,ArrayList<ArrayList<String>> graphDtlList ,final String groupCssTypeName,final String width,final String height,final String imageName,final HashMap<String, String>refrshMap, final JSONObject mainDataJsonCopy, final String groupName, final ArrayList<FilterInfo> filterList, String firstNameforTitle)
/*Add uniqueId parameter by Dhanendra on date 09-11-2015*/
private void getDisplayData(final JSONObject mainDataJson,ArrayList<ArrayList<String>> graphDtlList ,final String groupCssTypeName,final String width,final String height,final String imageName,final HashMap<String, String>refrshMap, final JSONObject mainDataJsonCopy, final String groupName, final ArrayList<FilterInfo> filterList, String firstNameforTitle, final String uniqueId)
{
int dataCnt = 0;
JSONObject graphJson = null;
......@@ -1763,9 +1969,13 @@ public class GraphComponent extends Composite
String strDate = dispDateTimeFormat.format(date);
String dateformat = getTimeSince(strDate);
Label refreshDateTime = new Label(dateformat);
this.createOuterDiv(groupName,"G",null);
idList.add(groupName+"Div");
HorizontalPanel componantTtlPanel = new HorizontalPanel();
/*add uniqueId to groupname by dhanendra on date 09-11-2015 */
this.createOuterDiv(groupName+uniqueId,"G",null);
idList.add(groupName+uniqueId+"Div");
/*End uniqueId to groupname by dhanendra on date 09-11-2015 */
HorizontalPanel componantTtlPanel = new HorizontalPanel();
HorizontalPanel dateHPanel = new HorizontalPanel();
componantTtlImg.setStyleName("componantTtlImg");
......@@ -1783,15 +1993,20 @@ public class GraphComponent extends Composite
mainPanel.add(dateHPanel);
mainPanel.setStyleName("mainPanel");
mainPanel.setCellHorizontalAlignment(dateHPanel, HasHorizontalAlignment.ALIGN_RIGHT);
RootPanel.get(groupName+"head").add(mainPanel);
/*add uniqueId to groupname by dhanendra on date 09-11-2015 */
RootPanel.get(groupName+uniqueId+"head").add(mainPanel);
/*end uniqueId to groupname by dhanendra on date 09-11-2015 */
String[] personArr = null;
String persondesg = "";
for (String multGrph : mainDataJson.keySet())
{
cnt++;
//Window.alert("multGrph :"+multGrph);
this.createInnerDiv(cnt,groupName);
/*add uniqueId to groupname by dhanendra on date 09-11-2015 */
this.createInnerDiv(uniqueId+cnt,groupName+uniqueId);
/*end uniqueId to groupname by dhanendra on date 09-11-2015 */
personArr = multGrph.split("@");
final String personName = personArr[0];
......@@ -1810,7 +2025,10 @@ public class GraphComponent extends Composite
designation.setStyleName("designationLable");
vPanel.add(hPanel);
vPanel.add(designation);
RootPanel.get("chart"+cnt).add(vPanel);
/*add uniqueId to groupname by dhanendra on date 09-11-2015 */
RootPanel.get("chart"+uniqueId+cnt).add(vPanel);
/*end uniqueId to groupname by dhanendra on date 09-11-2015 */
lableName.addClickHandler(new ClickHandler()
{
......@@ -1824,7 +2042,7 @@ public class GraphComponent extends Composite
getOnClickOpenGrid(personName.trim(),filterList);
}else
{
getOnClickFltrDataJson(mainDataJsonCopy, personName.trim(),refrshMap,groupCssTypeName, width, height, imageName,filterList);
getOnClickFltrDataJson(mainDataJsonCopy, personName.trim(),refrshMap,groupCssTypeName, width, height, imageName,filterList,uniqueId);
}
/*End if else condition to open a new window by Dhanendra on Date 16-10-2015*/
}
......@@ -1841,15 +2059,19 @@ public class GraphComponent extends Composite
getOnClickOpenGrid(personName.trim(),filterList);
}else
{
getOnClickFltrDataJson(mainDataJsonCopy, personName.trim(),refrshMap,groupCssTypeName, width, height, imageName,filterList);
getOnClickFltrDataJson(mainDataJsonCopy, personName.trim(),refrshMap,groupCssTypeName, width, height, imageName,filterList,uniqueId);
}
/*End if else condition to open a new window by Dhanendra on Date 16-10-2015*/
}
});
RootPanel.get("chart"+cnt).setStyleName(groupCssTypeName);
/*add uniqueId to chart by dhanendra on date 09-11-2015 */
RootPanel.get("chart"+uniqueId+cnt).setStyleName(groupCssTypeName);
/*end uniqueId to chart by dhanendra on date 09-11-2015 */
if(dataCnt == 0)
{
RootPanel.get("chart"+cnt).getElement().getStyle().setProperty("clear", "both");
/*add uniqueId to chart by dhanendra on date 09-11-2015 */
RootPanel.get("chart"+uniqueId+cnt).getElement().getStyle().setProperty("clear", "both");
/*end uniqueId to chart by dhanendra on date 09-11-2015 */
}
dataCnt++;
......@@ -1860,7 +2082,9 @@ public class GraphComponent extends Composite
}
if (graphJson != null && graphJson.size() > 0)
{
this.createChart(graphJson.toString().replace('@', '='), "chartContainer" + cnt, "chartContainer" + cnt, width, height, imageName,userMail,reportCaption);
/*add uniqueId to chartContainer by dhanendra on date 09-11-2015 */
this.createChart(graphJson.toString().replace('@', '='), "chartContainer" +uniqueId+ cnt, "chartContainer" +uniqueId+ cnt, width, height, imageName,userMail,reportCaption);
/*end uniqueId to chartContainer by dhanendra on date 09-11-2015 */
}
}
......
......@@ -56,7 +56,12 @@ public class SmartFiltrCreator extends Composite
GraphComponent component = null;
MetaDataDtl dataDtl = null;
ArrayList<FilterInfo> filterList=null;
public SmartFiltrCreator(LinkedHashMap<String, ArrayList<String>> datsSourceDtlMap, LinkedHashMap<String, JSONObject> componentDataMap, JSONObject jsonObjMetaData, ArrayList<String> parameterList,ArrayList<FilterInfo> filterList)
/*Declare idList Veriable by Dhanendra*/
ArrayList<String> idList = null;
/*Add idList Parameter in SmartFiltrCreator method by Dhanendra on Date 23-11-2015*/
public SmartFiltrCreator(LinkedHashMap<String, ArrayList<String>> datsSourceDtlMap, LinkedHashMap<String, JSONObject> componentDataMap, JSONObject jsonObjMetaData, ArrayList<String> parameterList,ArrayList<FilterInfo> filterList,ArrayList<String> idList)
{
this .filterList=filterList;
this.datsSourceDtlMap = datsSourceDtlMap;
......@@ -67,6 +72,9 @@ public class SmartFiltrCreator extends Composite
component = new GraphComponent(parameterList, jsonObjMetaData, "N");
dataDtl = new MetaDataDtl();
this.initPopUpPnl();
/*initialise idlist veriable by Dhanendra by Dhanendra on Date 23-11-2015*/
this.idList = idList;
/*initialise idlist veriable by Dhanendra by Dhanendra on Date 23-11-2015*/
}
private void initPopUpPnl()
......@@ -668,7 +676,8 @@ public class SmartFiltrCreator extends Composite
}
component.buildChart(filterdDataMap, dataDtl.getGridNMapMetData(jsonObjMetaData, viewOptionSelectd,parameterList),filterList);
/*Add idList Parameter to buildChart Method by Dhanendra on Date 23-11-2015*/
component.buildChart(filterdDataMap, dataDtl.getGridNMapMetData(jsonObjMetaData, viewOptionSelectd,parameterList),filterList,idList);
}
private void addMouseClickHndlr(Widget widget, final ArrayList<SmrtFilterInfo> smrtFltrDtlList)
......
......@@ -2,9 +2,9 @@ var actualChart = 0;
var imgNameArr=[];
var empcode = "";
var subjectName="";
var gantt_filter = 0;
function createFusionChart(jsonObj, containerId, chartContainer,width,height,imageName,userId,rptSubject)
{
//jsonObj='{"dataset":[{"valuePosition":"BELOW", "color":"#01DF3A", "data":[{"value":"19", "showValue":"1", "link":"p-detailsPopUp,width$1000,height$500,toolbar$no,scrollbars$yes,resizable$no-/ibase/dwh/GwtDashboardPage.html?metadataname=monthwiseactual&PRD_SALESDASH=201503&titleName=-Manufactured and Released Batches for Mar-2015&actual_batches_released=19&prd_code=Mar-2015"},{"value":"", "showValue":"1", "link":"p-detailsPopUp,width$1000,height$500,toolbar$no,scrollbars$yes,resizable$no-/ibase/dwh/GwtDashboardPage.html?metadataname=monthwiseactual&PRD_SALESDASH=201503&titleName=-Manufactured and Released Batches for In METIS Not in LIMS&actual_batches_released=&prd_code=In METIS Not in LIMS"}], "seriesname":"Released"},{"valuePosition":"BELOW", "color":"#FF0000", "data":[{"value":"33", "showValue":"1", "link":"p-detailsPopUp,width$1000,height$500,toolbar$no,scrollbars$yes,resizable$no-/ibase/dwh/GwtDashboardPage.html?metadataname=monthwisepending&PRD_SALESDASH=201503&titleName=-Manufactured and Released Batches for Mar-2015&pending_batches=33&prd_code=Mar-2015"},{"value":"", "showValue":"1", "link":"p-detailsPopUp,width$1000,height$500,toolbar$no,scrollbars$yes,resizable$no-/ibase/dwh/GwtDashboardPage.html?metadataname=monthwisepending&PRD_SALESDASH=201503&titleName=-Manufactured and Released Batches for In METIS Not in LIMS&pending_batches=&prd_code=In METIS Not in LIMS"}], "seriesname":"Not Released"},{"valuePosition":"BELOW", "color":"#FFFF00", "data":[{"value":"101", "showValue":"1", "link":"p-detailsPopUp,width$1000,height$500,toolbar$no,scrollbars$yes,resizable$no-/ibase/dwh/GwtDashboardPage.html?metadataname=tbdbatch&PRD_SALESDASH=201503&titleName=-Manufactured and Released Batches for Mar-2015&tbd_batches=101&prd_code=Mar-2015"},{"value":"149", "showValue":"1", "link":"p-detailsPopUp,width$1000,height$500,toolbar$no,scrollbars$yes,resizable$no-/ibase/dwh/GwtDashboardPage.html?metadataname=tbdbatch&PRD_SALESDASH=201503&titleName=-Manufactured and Released Batches for In METIS Not in LIMS&tbd_batches=149&prd_code=In METIS Not in LIMS"}], "seriesname":"In METIS Not in LIMS "}], "categories":{"category":[{"label":"Mar-2015"},{"label":"In METIS Not in LIMS"}]}, "chart":[{"caption":"HALOL - Manufactured & Released Batches-Timescale (06/04/2015)", "bgcolor":"", "showLegend":"1", "useroundedges":"1", "rotateValues":"0", "decimals":"1", "formatNumberScale":"0", "formatNumber":"1", "exportEnabled":"1", "exportAtClient":"0", "exportHandler":"FCExporter", "exportAction":"save", "xAxisName":"Production Completion Month/Target Release Week ", "yAxisName":"Number Of Batches", "anchorRadius":"0", "lineAlpha":"1", "anchorBorderThickness":"3", "pyaxisname":"Number of Batches", "syaxisname":"Number of Batches"}]}';
//off jsonObj='{ "chart": { "caption": "Sales Comparison by Country - 2011 vs 2012 vs 2013", "subcaption": "(Right-click to see the export modes available)", "exportEnabled": "1", "exportatclient": "0", "exportHandler":"FCExporter", "exportAction":"save", "bgcolor": "FFFFFF", "numberprefix": "$", "showvalues": "0", "plotgradientcolor": "", "showalternatehgridcolor": "0", "showplotborder": "0", "labeldisplay": "WRAP", "divlinecolor": "CCCCCC", "canvasborderalpha": "0" }, "categories": [ { "category": [ { "label": "Austria" }, { "label": "Brazil" }, { "label": "France" }, { "label": "Germany" }, { "label": "USA" } ] } ], "dataset": [ { "seriesname": "2011", "color": "008ee4", "data": [ { "value": "25601.34" }, { "value": "20148.82" }, { "value": "17372.76" }, { "value": "35407.15" }, { "value": "38105.68" } ] }, { "seriesname": "2012", "color": "6baa01", "data": [ { "value": "57401.85" }, { "value": "41941.19" }, { "value": "45263.37" }, { "value": "117320.16" }, { "value": "114845.27" } ] }, { "seriesname": "2013", "color": "f8bd19", "data": [ { "value": "45000.65" }, { "value": "44835.76" }, { "value": "18722.18" }, { "value": "77557.31" }, { "value": "92633.68" } ] } ] }';
try
......@@ -62,13 +62,6 @@ function createFusionChart(jsonObj, containerId, chartContainer,width,height,ima
/* Add 3 function for create dyanamic div for compliance Dashboard By Dhanendra On 28MAy2015 */
function outerDiv(outerDivId,type, cssName)
{
/*added code to remove frame container if exists on change of view by SWATI on 26 Aug 2015*/
var elem = document.getElementById("frameContainer");
if(elem!==null)
{
elem.parentNode.removeChild(elem);
}
/*Ended code to remove frame container if exists on change of view by SWATI on 26 Aug 2015*/
var outerDiv = document.createElement('div');
outerDiv.id = outerDivId+"Div";
if(cssName == null)
......@@ -93,10 +86,12 @@ function outerDiv(outerDivId,type, cssName)
headDiv.id = outerDivId+'head';
iDiv.appendChild(headDiv);
outerDiv.appendChild(iDiv);
//document.getElementsByTagName('body')[0].appendChild(outerDiv);
//alert("before");
document.getElementById('chartContainer').appendChild(outerDiv);
//alert("after");
/*Change code outerdiv append on body tag by Dhanendra on Date 23-11-2015*/
document.getElementsByTagName('body')[0].appendChild(outerDiv);
/*Change code outerdiv append on body tag by Dhanendra on Date 23-11-2015*/
//document.getElementById('chartContainer').appendChild(outerDiv);
}
function innerDiv(innerDivId,groupName)
{
......@@ -125,7 +120,7 @@ function createFrameContainer()
/* End 3 function for create dyanamic div for compliance Dashboard By Dhanendra On 28MAy2015 */
var remark = "The left side of the graph contains the month of completion of the manufacturing process of the batches and the laboratory status, green contains the number of the batches that were released by the lab., the red contains the number of batches that weren't yet released, Yellow contains the number of batches that have finished the production and the samples didn't yet reached the lab.The right side of the graph contains the estimated week of release of the red batches that appear in the left side of the graph.";
var remark = "The left side of the graph contains the month of completion of the manufacturing process of the batches and the laboratory status, green contains the number of the batches that were released by the lab., the red contains the number of batches that weren't yet released, Yellow contains the number of batches that have finished the production and the samples didn't yet reached the lab.The right side of the graph contains the estimated week of release of the red batches that appear in the left side of the graph.";
function getXMLHttpRequest()
{
var xmlHttpReq;
......@@ -206,359 +201,3 @@ function FC_Exported(objRtn)
}
}
/* Start Added five function createGanttChart ,filter_tasks ,set_scale_units,zoom_tasks,show_scale_options by sachin for Gantt Chart on 12 Aug 15 */
function createGanttChart(jsonObj,chartContainer,height,width)
{
jsonObj=jsonObj.replace(/ /g ,"");
var gantFltrDiv=document.getElementById("ganttfilter");
document.getElementById(chartContainer).appendChild(gantFltrDiv);
gantFltrDiv.style.visibility="visible";
var ganttRenderDiv = document.createElement('div');
ganttRenderDiv.id = "ganttRenderDiv";
document.getElementById(chartContainer).appendChild(ganttRenderDiv);
document.getElementById("ganttRenderDiv").style.height=height+"px";
try
{
/* var tasks={ data : [{id: 1 , text:" Analysis" , start_date:" 07-08-2015" , duration: 10 , order: 1 , progress: .6 , priority: 1 }, {id: 2 , text:" Coding" , start_date:" 07-08-2015" , duration: 10 , order: 2 , progress: .6 , priority: 1 , parent: 1 }, {id: 3 , text:" Testing" , start_date:" 07-08-2015" , duration: 10 , order: 3 , progress: .6 , priority: 1 , parent: 1 }, {id: 4 , text:" Integration" , start_date:" 07-08-2015" , duration: 10 , order: 4 , progress: .6 , priority: 1 , parent: 1 }, {id: 5 , text:" Marketing" , start_date:" 07-08-2015" , duration: 10 , order: 5 , progress: .6 , priority: 1 , parent: 1 }] };
// { data : [{id: 1 , text:" Analysis" , start_date:" 07-08-2015" , duration: 10 , order: 1 , progress: .6 , priority: 1 }, {id: 2 , text:" Coding" , start_date:" 07-08-2015" , duration: 10 , order: 2 , progress: .6 , priority: 1 , parent: 1 }, {id: 3 , text:" Testing" , start_date:" 07-08-2015" , duration: 10 , order: 3 , progress: .6 , priority: 1 , parent: 1 }, {id: 4 , text:" Integration" , start_date:" 07-08-2015" , duration: 10 , order: 4 , progress: .6 , priority: 1 , parent: 1 }, {id: 5 , text:" Marketing" , start_date:" 07-08-2015" , duration: 10 , order: 5 , progress: .6 , priority: 1 , parent: 1 }] }
*/
gantt.attachEvent("onBeforeTaskDisplay", function(id, task)
{
if (gantt_filter)
if (task.priority != gantt_filter)
return false;
return true;
});
gantt.templates.scale_cell_class = function(date)
{
if(date.getDay()==0||date.getDay()==6)
{
return "weekend";
}
};
gantt.templates.task_cell_class = function(item,date)
{
if(date.getDay()==0||date.getDay()==6)
{
return "weekend" ;
}
};
show_scale_options("day");
gantt.config.details_on_create = true;
gantt.templates.task_class = function(start, end, obj)
{
return obj.project ? "project" : "";
}
gantt.config.columns = [
{name:"text", label:"Task name", width:"*", tree:true },
/* {name:"progress", label:"Status", template:function(obj)
{
return Math.round(obj.progress*100)+"%";
}, align: "center", width:60 },
*/
{name:"priority", label:"Priority", template:function(obj)
{
return gantt.getLabel("priority", obj.priority);
}, align: "center", width:60 },
{name:"duration", label:"Duration", width:"*", tree:true },
{name:"add", label:"", width:44 }
];
gantt.config.grid_width = 390;
gantt.attachEvent("onTaskCreated", function(obj){
obj.duration = 4;
obj.progress = 0.25;
return true;
});
gantt.locale.labels["section_priority"] = "Priority";
gantt.config.lightbox.sections = [
{name: "description", height: 38, map_to: "text", type: "textarea", focus: true},
{name: "priority", height: 22, map_to: "priority", type: "select", options: [
{key:"1", label: "Low"},
{key:"0", label: "Normal"},
{key:"2", label: "High"} ]},
{name: "time", height: 72, type: "duration", map_to: "auto", time_format:["%d","%m","%Y","%H:%i"]}
];
//End of function
gantt.init(ganttRenderDiv);
gantt.parse(jsonObj);
}
catch(e)
{
alert( "Excpeiton :: createGanttChart ["+e.message+"]" );
}
}
function filter_tasks(node)
{
gantt_filter = node.value;
gantt.refreshData();
}
function set_scale_units(mode)
{/*
if(mode && mode.getAttribute){
mode = mode.getAttribute("value");
}
switch (mode)
{
case "work_hours":
gantt.config.subscales = [
{unit:"hour", step:1, date:"%H"}
];
gantt.ignore_time = function(date){
if(date.getHours() < 9 || date.getHours() > 16){
return true;
}else{
return false;
}
};
break;
case "full_day":
gantt.config.subscales = [
{unit:"hour", step:3, date:"%H"}
];
gantt.ignore_time = null;
break;
case "work_week":
gantt.ignore_time = function(date){
if(date.getDay() == 0 || date.getDay() == 6){
return true;
}else{
return false;
}
};
break;case "month":
gantt.config.min_column_width = 70;
gantt.config.scale_unit = "week";
gantt.config.date_scale = "Week #%W";
gantt.config.subscales = [
{unit:"day", step:1, date:"%D"}
];
show_scale_options();
gantt.config.scale_height = 60;
break;
default:
gantt.ignore_time = null;
break;
}
gantt.render();
*/}
function zoom_tasks(node){
switch(node.value){
case "hours":
gantt.config.scale_unit = "day";
gantt.config.date_scale = "%d %M";
gantt.config.scale_height = 60;
gantt.config.min_column_width = 30;
gantt.config.subscales = [
{unit:"hour", step:1, date:"%H"}
];
show_scale_options("hour");
break;
case "days":
/*gantt.config.min_column_width = 70;
gantt.config.scale_unit = "day";
gantt.config.date_scale = "%d %M";
gantt.config.subscales = [ ];
gantt.config.scale_height = 35;
show_scale_options("day");*/
gantt.config.scale_unit = "day";
gantt.config.step = 1;
gantt.config.date_scale = "%d %M";
gantt.config.subscales = [];
gantt.config.scale_height = 27;
gantt.templates.date_scale = null;
break;
case "weeks":
gantt.templates.date_scale = null;
/*gantt.config.min_column_width = 70;
gantt.config.scale_unit = "week";
gantt.config.date_scale = "Week #%W";
gantt.config.subscales = [
{unit:"day", step:1, date:"%D"}
];
show_scale_options();
gantt.config.scale_height = 60;*/
var weekScaleTemplate = function(date){
var dateToStr = gantt.date.date_to_str("%d %M");
var endDate = gantt.date.add(gantt.date.add(date, 1, "week"), -1, "day");
return dateToStr(date) + " - " + dateToStr(endDate);
};
gantt.config.scale_unit = "week";
//gantt.config.step = 1;
gantt.templates.date_scale = weekScaleTemplate;
/*gantt.config.subscales = [
{unit:"day", step:1, date:"%D" }
];*/
//gantt.config.scale_height = 50;
break;
case "months":
gantt.config.min_column_width = 70;
gantt.config.scale_unit = "month";
gantt.config.date_scale = "%M";
//gantt.config.scale_height = 60;
show_scale_options();
gantt.config.subscales = [
// {unit:"", step:1, date:""}
];
gantt.templates.date_scale = null;
break;
}
//set_scale_units();
gantt.render();
}
function show_scale_options(mode){/*
var hourConf = document.getElementById("filter_hours"),
dayConf = document.getElementById("filter_days");
if(mode == 'day'){
hourConf.style.display = "none";
dayConf.style.display = "";
dayConf.getElementsByTagName("input")[0].checked = true;
}else if(mode == "hour"){
hourConf.style.display = "";
dayConf.style.display = "none";
hourConf.getElementsByTagName("input")[0].checked = true;
}else{
hourConf.style.display = "none";
dayConf.style.display = "none";
}*/
}
/*End Added five function createGanttChart ,filter_tasks ,set_scale_units,zoom_tasks,show_scale_options by sachin for Gantt Chart on 12 Aug 15 */
/*var tasks = {
data:[
{id:1, text:"Project #1", start_date:"01-04-2013", duration:18,order:10, progress:0.4, open: true,priority:2},
{id:2, text:"Task #1", start_date:"02-04-2013", duration:8, order:10, progress:0.6, parent:1,priority:1},
{id:3, text:"Task #2", start_date:"11-04-2013", duration:8, order:20, progress:0.6, parent:1,priority:2},
{id:4, text:"Task #3", start_date:"4-04-2013", duration:10, order:20, progress:0.6, parent:1,priority:1},
{id:5, text:"Project #2", start_date:"01-04-2013", duration:18,order:11, progress:0.4, open: true,priority:1},
{id:6, text:"Task #1", start_date:"02-04-2013", duration:6, order:12, progress:0.6, parent:5,priority:2},
{id:7, text:"Task #2", start_date:"11-04-2013", duration:9, order:13, progress:0.6, parent:5,priority:1},
{id:8, text:"Task #3", start_date:"4-04-2013", duration:14, order:14, progress:0.6, parent:5,priority:2},
{id:9, text:"Analysis", start_date:"07-04-2013", duration:10, order:1, progress:0.6, priority:1, parent:1},
{id:10, text:"Coding", start_date:"07-04-2013", duration:10, order:2, progress:0.6, priority:1, parent:5},
],
links:
[
{ id:1, source:1, target:2, type:"1"},
{ id:2, source:2, target:3, type:"0"},
{ id:3, source:3, target:4, type:"0"},
{ id:4, source:4, target:5, type:"2"},
{ id:5, source:5, target:6, type:"1"},
{ id:6, source:6, target:7, type:"0"},
{ id:7, source:7, target:8, type:"0"},
{ id:8, source:8, target:9, type:"2"},
]
};*/
/* Start Added function createGaugeChart by sachin for Gauge Chart on 28 Aug 15 */
function createGaugeChart(jsonObj, chartContainer, height, width) {
//alert("jsonObj is =" + jsonObj);
var parsedData = JSON.parse(jsonObj);
var innerDiv = document.createElement('canvas');
innerDiv.id = "canvasDiv"+chartContainer;
innerDiv.width = parsedData.metaData[0].width;
innerDiv.height = parsedData.metaData[0].height;
document.getElementById(chartContainer).appendChild(innerDiv);
var aGauge = aGauge = new AquaGauge('canvasDiv'+chartContainer);
aGauge.props.minValue = parsedData.metaData[0].minValue;
aGauge.props.maxvalue = parsedData.metaData[0].maxValue;
aGauge.props.noofdivisions = parsedData.metaData[0].noOfDivisions;
aGauge.props.noOfSubDivisions = parsedData.metaData[0].noOfSubDivisions;
aGauge.props.showMinorScaleValue = parsedData.metaData[0].showMinorScaleValue;
aGauge.props.dialSubTitle = parsedData.metaData[0].sub_caption;
aGauge.props.dialTitle = parsedData.metaData[0].caption;
var pointrColor = parsedData.metaData[0].pointerColor;
if (pointrColor != undefined && pointrColor.trim().length > 0)
{
aGauge.props.pointerColor = pointrColor;
}
var bgColor = parsedData.metaData[0].bg_color;
if (bgColor != undefined && bgColor.trim().length > 0)
{
aGauge.props.backgroundColor = bgColor;
}
//alert("parsedData.data[0].refresh ="+parsedData.data[0].refresh);
aGauge.refresh(parsedData.data[0].refresh);
}
/* End Added function createGaugeChart by sachin for Gauge Chart on 28 Aug 15 */
/*Added new method to call js function on link for bar by swati 18 Aug 2015*/
function linkFunction(metadataName, cellValue, propertyStr, urlStr, parameterListString, status)
{
createFrameContainer();
document.getElementById('frameContainer').innerHTML = "<iframe scrolling='no' id='frame1' width='99%' height='280' frameborder='0' src='/ibase/dwh/GwtDashboardPage.html?metadataname="+metadataName+propertyStr+"&"+parameterListString+"&CELL_VAL="+cellValue.trim()+"&FLAG=N'></iframe>";
}
/*Ended new method to call js function on link for bar by swati 18 Aug 2015*/
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment