Commit a3c43c2d authored by dkasliwal's avatar dkasliwal

Add summary value at componnet title panel and change css for grid and graph card and bubble chart.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104936 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1fd453f7
...@@ -206,7 +206,9 @@ public class GraphComponent extends Composite ...@@ -206,7 +206,9 @@ public class GraphComponent extends Composite
/*Add Veriable by Dhanendra on 20-10-2015*/ /*Add Veriable by Dhanendra on 20-10-2015*/
HashMap<String, ArrayList<String>> gridComponantDescrMap = null; HashMap<String, ArrayList<String>> gridComponantDescrMap = null;
HashMap<String, ArrayList<String>> gridComponantSubTitleMap = null;
String gridComponantDescr = ""; String gridComponantDescr = "";
String gridComponantSubTitle = "";
String graphComponantDescr = ""; String graphComponantDescr = "";
CommonUtils.printOnConsole("@@@@@@@@@@ idList :"+idList); CommonUtils.printOnConsole("@@@@@@@@@@ idList :"+idList);
if (idList.size() > 0) if (idList.size() > 0)
...@@ -291,6 +293,9 @@ public class GraphComponent extends Composite ...@@ -291,6 +293,9 @@ public class GraphComponent extends Composite
gridComponantDescrMap = gridNGraphMeataDataMap.get("componantDescr"+componentId); gridComponantDescrMap = gridNGraphMeataDataMap.get("componantDescr"+componentId);
gridComponantDescr = ""+ gridComponantDescrMap.get("componantDescr"+componentId); gridComponantDescr = ""+ gridComponantDescrMap.get("componantDescr"+componentId);
gridComponantSubTitleMap = gridNGraphMeataDataMap.get("componentSubTitle"+componentId);
gridComponantSubTitle = ""+ gridComponantSubTitleMap.get("componentSubTitle"+componentId);
} }
jsonObjFrGraph = (JSONObject) dataMap.get(dtSrouce); jsonObjFrGraph = (JSONObject) dataMap.get(dtSrouce);
if ("G".equalsIgnoreCase(type)) if ("G".equalsIgnoreCase(type))
...@@ -422,6 +427,7 @@ public class GraphComponent extends Composite ...@@ -422,6 +427,7 @@ public class GraphComponent extends Composite
{ {
mainPanel.add(closeButton); mainPanel.add(closeButton);
mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT); mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT);
mainPanel.setCellVerticalAlignment(closeButton, HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.setCellWidth( closeButton, "2%" ); mainPanel.setCellWidth( closeButton, "2%" );
} }
...@@ -575,6 +581,7 @@ public class GraphComponent extends Composite ...@@ -575,6 +581,7 @@ public class GraphComponent extends Composite
{ {
mainPanel.add(closeButton); mainPanel.add(closeButton);
mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT); mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT);
mainPanel.setCellVerticalAlignment(closeButton, HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.setCellWidth( closeButton, "2%" ); mainPanel.setCellWidth( closeButton, "2%" );
} }
/*End Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/ /*End Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
...@@ -814,6 +821,7 @@ public class GraphComponent extends Composite ...@@ -814,6 +821,7 @@ public class GraphComponent extends Composite
{ {
mainPanel.add(closeButton); mainPanel.add(closeButton);
mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT); mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT);
mainPanel.setCellVerticalAlignment(closeButton, HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.setCellWidth( closeButton, "2%" ); mainPanel.setCellWidth( closeButton, "2%" );
} }
/*End Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/ /*End Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
...@@ -964,6 +972,23 @@ public class GraphComponent extends Composite ...@@ -964,6 +972,23 @@ public class GraphComponent extends Composite
horizontalPanel.add(gridTtlPanel); horizontalPanel.add(gridTtlPanel);
mainPanel.add(horizontalPanel); mainPanel.add(horizontalPanel);
if(gridComponantSubTitle.length()>0)
{
double summaryValue = data.getSubTitleSummary(jsonObjFrGraph, dtSrouce, gridComponantSubTitle);
Label subTitleValLabel = new Label(NumberFormat.getInstance().format(summaryValue));
Label subTitleINRLabel = new Label("INR");
subTitleValLabel.setStyleName("titleValLabel");
subTitleINRLabel.setStyleName("titleValINRLabel");
HorizontalPanel subTitlePanel = new HorizontalPanel();
subTitlePanel.setStyleName("titleValPanel");
subTitlePanel.add(subTitleValLabel);
subTitlePanel.add(subTitleINRLabel);
subTitlePanel.setCellVerticalAlignment(subTitleINRLabel, HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.add(subTitlePanel);
}
/*Add code for display popup menu on mouse over on component icon image by Dhanendra on date 23-02-2017*/ /*Add code for display popup menu on mouse over on component icon image by Dhanendra on date 23-02-2017*/
if(gridComponantDescr.length()>0) if(gridComponantDescr.length()>0)
{ {
...@@ -990,6 +1015,7 @@ public class GraphComponent extends Composite ...@@ -990,6 +1015,7 @@ public class GraphComponent extends Composite
{ {
mainPanel.add(closeButton); mainPanel.add(closeButton);
mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT); mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT);
mainPanel.setCellVerticalAlignment(closeButton, HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.setCellWidth( closeButton, "2%" ); mainPanel.setCellWidth( closeButton, "2%" );
} }
...@@ -1417,6 +1443,7 @@ public class GraphComponent extends Composite ...@@ -1417,6 +1443,7 @@ public class GraphComponent extends Composite
{ {
mainPanel.add(closeButton); mainPanel.add(closeButton);
mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT); mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT);
mainPanel.setCellVerticalAlignment(closeButton, HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.setCellWidth( closeButton, "2%" ); mainPanel.setCellWidth( closeButton, "2%" );
} }
...@@ -1688,6 +1715,7 @@ public class GraphComponent extends Composite ...@@ -1688,6 +1715,7 @@ public class GraphComponent extends Composite
{ {
mainPanel.add(closeButton); mainPanel.add(closeButton);
mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT); mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT);
mainPanel.setCellVerticalAlignment(closeButton, HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.setCellWidth( closeButton, "2%" ); mainPanel.setCellWidth( closeButton, "2%" );
} }
...@@ -1703,7 +1731,7 @@ public class GraphComponent extends Composite ...@@ -1703,7 +1731,7 @@ public class GraphComponent extends Composite
graphJson = ChartCreator.getBubbleChart(graphDtlList, jsonObjFrGraph, dtSrouce); graphJson = ChartCreator.getBubbleChart(graphDtlList, jsonObjFrGraph, dtSrouce);
idList.add("Bubble"+uniqueId+componentId+"Div"); idList.add("Bubble"+uniqueId+componentId+"Div");
RootPanel.get("Bubble"+uniqueId+componentId+"head").add(mainPanel); RootPanel.get("Bubble"+uniqueId+componentId+"head").add(mainPanel);
this.createBubbleChart(graphJson.toString(), "Bubble"+uniqueId+componentId,xAxisLbl,yAxisLbl,zAxisLbl); this.createBubbleChart(graphJson.toString(), "Bubble"+uniqueId+componentId,xAxisLbl,yAxisLbl,zAxisLbl,true);
/*CommonUtils.printOnConsole("In BUBBLE GraphComponent File"); /*CommonUtils.printOnConsole("In BUBBLE GraphComponent File");
this.createOuterDiv("Bubble"+uniqueId+componentId, type, gridCssName, "chartContainer"); this.createOuterDiv("Bubble"+uniqueId+componentId, type, gridCssName, "chartContainer");
...@@ -1986,10 +2014,10 @@ public class GraphComponent extends Composite ...@@ -1986,10 +2014,10 @@ public class GraphComponent extends Composite
} }
}-*/; }-*/;
private native void createBubbleChart(String chartData, String chartContainer, String xAxisLbl,String yAxisLbl,String zAxisLbl) private native void createBubbleChart(String chartData, String chartContainer, String xAxisLbl,String yAxisLbl,String zAxisLbl,boolean isCreateContainer)
/*-{ /*-{
try { try {
$wnd.bubbleChart(chartData, chartContainer,xAxisLbl,yAxisLbl,zAxisLbl); $wnd.bubbleChart(chartData, chartContainer,xAxisLbl,yAxisLbl,zAxisLbl,isCreateContainer);
} catch (e) { } catch (e) {
alert("Excpeiton :: GraphComponent : createBubbleChart [" + e.message + "]"); alert("Excpeiton :: GraphComponent : createBubbleChart [" + e.message + "]");
} }
...@@ -2305,6 +2333,7 @@ public class GraphComponent extends Composite ...@@ -2305,6 +2333,7 @@ public class GraphComponent extends Composite
mainPanel.setStyleName("mainPanel"); mainPanel.setStyleName("mainPanel");
mainPanel.setCellHorizontalAlignment(dateHPanel, HasHorizontalAlignment.ALIGN_RIGHT); mainPanel.setCellHorizontalAlignment(dateHPanel, HasHorizontalAlignment.ALIGN_RIGHT);
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/ /*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
//RootPanel.get("Graph"+uniqueId+componentId+"head").add(mainPanel); //RootPanel.get("Graph"+uniqueId+componentId+"head").add(mainPanel);
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/ /*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
...@@ -2518,7 +2547,22 @@ public class GraphComponent extends Composite ...@@ -2518,7 +2547,22 @@ public class GraphComponent extends Composite
} }
} }
/**end of card build method by sachin 10 July 2015**/ /**end of card build method by sachin 10 July 2015**/
if ("BUBBLE".equalsIgnoreCase(type))
{
for (String graphNo : graphDataMap.keySet())
{
graphDtlList = graphDataMap.get(graphNo);
graphJson = ChartCreator.getBubbleChart(graphDtlList, jsonObjFrGraph, dtSrouce);
CommonUtils.printOnConsole("---------------------In BUBBLE-----------------------");
CommonUtils.printOnConsole("containerIdList.get(countForSmartFilter) :"+containerIdList.get(countForSmartFilter));
String containerId = containerIdList.get(countForSmartFilter).replace("Bubble", "").replace("Div", "").trim();
CommonUtils.printOnConsole("containerId : "+containerId);
RootPanel.get("canvasBubble"+containerId).clear();
CommonUtils.printOnConsole("After Div Clear");
this.createBubbleChart(graphJson.toString(), "Bubble"+containerId,"x","y","z",false);
CommonUtils.printOnConsole("After createBubbleChart");
}
}
countForSmartFilter++; countForSmartFilter++;
} }
...@@ -2747,7 +2791,7 @@ public class GraphComponent extends Composite ...@@ -2747,7 +2791,7 @@ public class GraphComponent extends Composite
{ {
//Added By Suraj [To set initial JSON String ]Start //Added By Suraj [To set initial JSON String ]Start
String responseJson = response.getText(); String responseJson = response.getText();
CommonUtils.printOnConsole("1111 responseJson ["+responseJson+"]"); //CommonUtils.printOnConsole("1111 responseJson ["+responseJson+"]");
setJson( responseJson ); setJson( responseJson );
//Added By Suraj [To set initial JSON String ]End //Added By Suraj [To set initial JSON String ]End
JSONObject servletJsnObj = (JSONObject) JSONParser.parseStrict(response.getText()); JSONObject servletJsnObj = (JSONObject) JSONParser.parseStrict(response.getText());
...@@ -4168,7 +4212,8 @@ public class GraphComponent extends Composite ...@@ -4168,7 +4212,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject(); rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>(); catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_over_3days); catValues.put("Over due", ""+overdue_over_3days);
catValues.put("Projected due", "0");
rawJson.put("date", new JSONString(""+count)); rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue over 3days")); rawJson.put("status",new JSONString("Overdue over 3days"));
rawJson.put("category_value",new JSONString(catValues.toString().replace("=", ":"))); rawJson.put("category_value",new JSONString(catValues.toString().replace("=", ":")));
...@@ -4180,7 +4225,8 @@ public class GraphComponent extends Composite ...@@ -4180,7 +4225,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject(); rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>(); catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_over_2days); catValues.put("Over due", ""+overdue_over_2days);
catValues.put("Projected due", "0");
rawJson.put("date", new JSONString(""+count)); rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue over 2days")); rawJson.put("status",new JSONString("Overdue over 2days"));
//rawJson.put("category_value",new JSONString(""+catValues)); //rawJson.put("category_value",new JSONString(""+catValues));
...@@ -4190,7 +4236,8 @@ public class GraphComponent extends Composite ...@@ -4190,7 +4236,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject(); rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>(); catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_yesterday); catValues.put("Over due", ""+overdue_yesterday);
catValues.put("Projected due", "0");
rawJson.put("date", new JSONString(""+count)); rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue yesterday")); rawJson.put("status",new JSONString("Overdue yesterday"));
//rawJson.put("category_value",new JSONString(""+catValues)); //rawJson.put("category_value",new JSONString(""+catValues));
...@@ -4200,7 +4247,8 @@ public class GraphComponent extends Composite ...@@ -4200,7 +4247,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject(); rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>(); catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_today); catValues.put("Over due", "0");
catValues.put("Projected due", ""+overdue_today);
rawJson.put("date", new JSONString(""+count)); rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue today")); rawJson.put("status",new JSONString("Overdue today"));
rawJson.put("category_value",new JSONString(catValues.toString().replace("=", ":"))); rawJson.put("category_value",new JSONString(catValues.toString().replace("=", ":")));
...@@ -4210,7 +4258,8 @@ public class GraphComponent extends Composite ...@@ -4210,7 +4258,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject(); rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>(); catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_tomorrow); catValues.put("Over due", "0");
catValues.put("Projected due", ""+overdue_tomorrow);
rawJson.put("date", new JSONString(""+count)); rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue tomorrow")); rawJson.put("status",new JSONString("Overdue tomorrow"));
//rawJson.put("category_value",new JSONString(""+catValues)); //rawJson.put("category_value",new JSONString(""+catValues));
...@@ -4220,7 +4269,8 @@ public class GraphComponent extends Composite ...@@ -4220,7 +4269,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject(); rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>(); catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_day_after); catValues.put("Over due", "0");
catValues.put("Projected due", ""+overdue_day_after);
rawJson.put("date", new JSONString(""+count)); rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue day after")); rawJson.put("status",new JSONString("Overdue day after"));
//rawJson.put("category_value",new JSONString(""+catValues)); //rawJson.put("category_value",new JSONString(""+catValues));
...@@ -4230,7 +4280,8 @@ public class GraphComponent extends Composite ...@@ -4230,7 +4280,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject(); rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>(); catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_rest_of_week); catValues.put("Over due", "0");
catValues.put("Projected due", ""+overdue_rest_of_week);
rawJson.put("date", new JSONString(""+count)); rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue rest of week")); rawJson.put("status",new JSONString("Overdue rest of week"));
//rawJson.put("category_value",new JSONString(""+catValues)); //rawJson.put("category_value",new JSONString(""+catValues));
...@@ -4240,7 +4291,8 @@ public class GraphComponent extends Composite ...@@ -4240,7 +4291,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject(); rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>(); catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_next_week); catValues.put("Over due", "0");
catValues.put("Projected due", ""+overdue_next_week);
rawJson.put("date", new JSONString(""+count)); rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue next week")); rawJson.put("status",new JSONString("Overdue next week"));
//rawJson.put("category_value",new JSONString(""+catValues)); //rawJson.put("category_value",new JSONString(""+catValues));
...@@ -4250,7 +4302,8 @@ public class GraphComponent extends Composite ...@@ -4250,7 +4302,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject(); rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>(); catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_next_month); catValues.put("Over due", "0");
catValues.put("Projected due", ""+overdue_next_month);
rawJson.put("date", new JSONString(""+count)); rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue next month")); rawJson.put("status",new JSONString("Overdue next month"));
//rawJson.put("category_value",new JSONString(""+catValues)); //rawJson.put("category_value",new JSONString(""+catValues));
......
...@@ -625,6 +625,7 @@ public class SmartFiltrCreator extends Composite ...@@ -625,6 +625,7 @@ public class SmartFiltrCreator extends Composite
public void getFilterdJson(HashMap<String, ArrayList<String>> selectedDataMap) public void getFilterdJson(HashMap<String, ArrayList<String>> selectedDataMap)
{ {
//Window.alert("In getFilterdJson");
ArrayList<String> presentKeyList = null; ArrayList<String> presentKeyList = null;
JSONObject dataJsn = null; JSONObject dataJsn = null;
JSONObject fetchRowWiseVal = null; JSONObject fetchRowWiseVal = null;
...@@ -682,38 +683,38 @@ public class SmartFiltrCreator extends Composite ...@@ -682,38 +683,38 @@ public class SmartFiltrCreator extends Composite
filterdDataMap.put(entry.getKey(), filtrdJsn); filterdDataMap.put(entry.getKey(), filtrdJsn);
} }
*/ */
for (int jsnCnt = 0; jsnCnt < dataJsn.size(); jsnCnt++) for (int jsnCnt = 0; jsnCnt < dataJsn.size(); jsnCnt++)
{ {
fetchRowWiseVal = (JSONObject) dataJsn.get(String.valueOf(jsnCnt)); fetchRowWiseVal = (JSONObject) dataJsn.get(String.valueOf(jsnCnt));
filtrdJsn = new JSONObject(); filtrdJsn = new JSONObject();
int count = 0; int count = 0;
for (SmrtFilterInfo smartFiltrInfo : fltrDtlList) for (SmrtFilterInfo smartFiltrInfo : fltrDtlList)
{
if (selectedDataMap.containsKey(smartFiltrInfo.getFltrColName()))
{ {
if (selectedDataMap.containsKey(smartFiltrInfo.getFltrColName())) selectedDataList = selectedDataMap.get(smartFiltrInfo.getFltrColName());
if (fetchRowWiseVal.containsKey(smartFiltrInfo.getFltrColName()))
{ {
selectedDataList = selectedDataMap.get(smartFiltrInfo.getFltrColName()); data = "" + fetchRowWiseVal.get(smartFiltrInfo.getFltrColName());
if (fetchRowWiseVal.containsKey(smartFiltrInfo.getFltrColName())) data = data.replace('"', ' ');
{ if (selectedDataList.contains(data.trim()))
data = "" + fetchRowWiseVal.get(smartFiltrInfo.getFltrColName()); {
data = data.replace('"', ' '); count++;
if (selectedDataList.contains(data.trim())) }
{
count++;
}
}
} }
} }
if (fltrDtlList.size() == count) }
{ if (fltrDtlList.size() == count)
dataJsnObj.put("" + cnt, fetchRowWiseVal); {
cnt++; dataJsnObj.put("" + cnt, fetchRowWiseVal);
} cnt++;
} }
filtrdJsn.put(entry.getKey(), dataJsnObj);
//if (dataJsnObj.toString().length() > 5) }
filterdDataMap.put(entry.getKey(), filtrdJsn); filtrdJsn.put(entry.getKey(), dataJsnObj);
//if (dataJsnObj.toString().length() > 5)
filterdDataMap.put(entry.getKey(), filtrdJsn);
} }
/*Add idList Parameter to buildChart Method by Dhanendra on Date 23-11-2015*/ /*Add idList Parameter to buildChart Method by Dhanendra on Date 23-11-2015*/
......
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