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
/*Add Veriable by Dhanendra on 20-10-2015*/
HashMap<String, ArrayList<String>> gridComponantDescrMap = null;
HashMap<String, ArrayList<String>> gridComponantSubTitleMap = null;
String gridComponantDescr = "";
String gridComponantSubTitle = "";
String graphComponantDescr = "";
CommonUtils.printOnConsole("@@@@@@@@@@ idList :"+idList);
if (idList.size() > 0)
......@@ -291,6 +293,9 @@ public class GraphComponent extends Composite
gridComponantDescrMap = gridNGraphMeataDataMap.get("componantDescr"+componentId);
gridComponantDescr = ""+ gridComponantDescrMap.get("componantDescr"+componentId);
gridComponantSubTitleMap = gridNGraphMeataDataMap.get("componentSubTitle"+componentId);
gridComponantSubTitle = ""+ gridComponantSubTitleMap.get("componentSubTitle"+componentId);
}
jsonObjFrGraph = (JSONObject) dataMap.get(dtSrouce);
if ("G".equalsIgnoreCase(type))
......@@ -422,6 +427,7 @@ public class GraphComponent extends Composite
{
mainPanel.add(closeButton);
mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT);
mainPanel.setCellVerticalAlignment(closeButton, HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.setCellWidth( closeButton, "2%" );
}
......@@ -575,6 +581,7 @@ public class GraphComponent extends Composite
{
mainPanel.add(closeButton);
mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT);
mainPanel.setCellVerticalAlignment(closeButton, HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.setCellWidth( closeButton, "2%" );
}
/*End Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
......@@ -814,6 +821,7 @@ public class GraphComponent extends Composite
{
mainPanel.add(closeButton);
mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT);
mainPanel.setCellVerticalAlignment(closeButton, HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.setCellWidth( closeButton, "2%" );
}
/*End Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
......@@ -964,6 +972,23 @@ public class GraphComponent extends Composite
horizontalPanel.add(gridTtlPanel);
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*/
if(gridComponantDescr.length()>0)
{
......@@ -990,6 +1015,7 @@ public class GraphComponent extends Composite
{
mainPanel.add(closeButton);
mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT);
mainPanel.setCellVerticalAlignment(closeButton, HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.setCellWidth( closeButton, "2%" );
}
......@@ -1417,6 +1443,7 @@ public class GraphComponent extends Composite
{
mainPanel.add(closeButton);
mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT);
mainPanel.setCellVerticalAlignment(closeButton, HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.setCellWidth( closeButton, "2%" );
}
......@@ -1688,6 +1715,7 @@ public class GraphComponent extends Composite
{
mainPanel.add(closeButton);
mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT);
mainPanel.setCellVerticalAlignment(closeButton, HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.setCellWidth( closeButton, "2%" );
}
......@@ -1703,7 +1731,7 @@ public class GraphComponent extends Composite
graphJson = ChartCreator.getBubbleChart(graphDtlList, jsonObjFrGraph, dtSrouce);
idList.add("Bubble"+uniqueId+componentId+"Div");
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");
this.createOuterDiv("Bubble"+uniqueId+componentId, type, gridCssName, "chartContainer");
......@@ -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 {
$wnd.bubbleChart(chartData, chartContainer,xAxisLbl,yAxisLbl,zAxisLbl);
$wnd.bubbleChart(chartData, chartContainer,xAxisLbl,yAxisLbl,zAxisLbl,isCreateContainer);
} catch (e) {
alert("Excpeiton :: GraphComponent : createBubbleChart [" + e.message + "]");
}
......@@ -2305,6 +2333,7 @@ public class GraphComponent extends Composite
mainPanel.setStyleName("mainPanel");
mainPanel.setCellHorizontalAlignment(dateHPanel, HasHorizontalAlignment.ALIGN_RIGHT);
/*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*/
......@@ -2518,7 +2547,22 @@ public class GraphComponent extends Composite
}
}
/**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++;
}
......@@ -2747,7 +2791,7 @@ public class GraphComponent extends Composite
{
//Added By Suraj [To set initial JSON String ]Start
String responseJson = response.getText();
CommonUtils.printOnConsole("1111 responseJson ["+responseJson+"]");
//CommonUtils.printOnConsole("1111 responseJson ["+responseJson+"]");
setJson( responseJson );
//Added By Suraj [To set initial JSON String ]End
JSONObject servletJsnObj = (JSONObject) JSONParser.parseStrict(response.getText());
......@@ -4168,7 +4212,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject();
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("status",new JSONString("Overdue over 3days"));
rawJson.put("category_value",new JSONString(catValues.toString().replace("=", ":")));
......@@ -4180,7 +4225,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject();
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("status",new JSONString("Overdue over 2days"));
//rawJson.put("category_value",new JSONString(""+catValues));
......@@ -4190,7 +4236,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject();
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("status",new JSONString("Overdue yesterday"));
//rawJson.put("category_value",new JSONString(""+catValues));
......@@ -4200,7 +4247,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject();
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("status",new JSONString("Overdue today"));
rawJson.put("category_value",new JSONString(catValues.toString().replace("=", ":")));
......@@ -4210,7 +4258,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject();
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("status",new JSONString("Overdue tomorrow"));
//rawJson.put("category_value",new JSONString(""+catValues));
......@@ -4220,7 +4269,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject();
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("status",new JSONString("Overdue day after"));
//rawJson.put("category_value",new JSONString(""+catValues));
......@@ -4230,7 +4280,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject();
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("status",new JSONString("Overdue rest of week"));
//rawJson.put("category_value",new JSONString(""+catValues));
......@@ -4240,7 +4291,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject();
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("status",new JSONString("Overdue next week"));
//rawJson.put("category_value",new JSONString(""+catValues));
......@@ -4250,7 +4302,8 @@ public class GraphComponent extends Composite
rawJson = new JSONObject();
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("status",new JSONString("Overdue next month"));
//rawJson.put("category_value",new JSONString(""+catValues));
......
......@@ -625,6 +625,7 @@ public class SmartFiltrCreator extends Composite
public void getFilterdJson(HashMap<String, ArrayList<String>> selectedDataMap)
{
//Window.alert("In getFilterdJson");
ArrayList<String> presentKeyList = null;
JSONObject dataJsn = null;
JSONObject fetchRowWiseVal = null;
......@@ -682,38 +683,38 @@ public class SmartFiltrCreator extends Composite
filterdDataMap.put(entry.getKey(), filtrdJsn);
}
*/
for (int jsnCnt = 0; jsnCnt < dataJsn.size(); jsnCnt++)
{
fetchRowWiseVal = (JSONObject) dataJsn.get(String.valueOf(jsnCnt));
filtrdJsn = new JSONObject();
int count = 0;
for (SmrtFilterInfo smartFiltrInfo : fltrDtlList)
for (int jsnCnt = 0; jsnCnt < dataJsn.size(); jsnCnt++)
{
fetchRowWiseVal = (JSONObject) dataJsn.get(String.valueOf(jsnCnt));
filtrdJsn = new JSONObject();
int count = 0;
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());
if (fetchRowWiseVal.containsKey(smartFiltrInfo.getFltrColName()))
{
data = "" + fetchRowWiseVal.get(smartFiltrInfo.getFltrColName());
data = data.replace('"', ' ');
if (selectedDataList.contains(data.trim()))
{
count++;
}
}
data = "" + fetchRowWiseVal.get(smartFiltrInfo.getFltrColName());
data = data.replace('"', ' ');
if (selectedDataList.contains(data.trim()))
{
count++;
}
}
}
if (fltrDtlList.size() == count)
{
dataJsnObj.put("" + cnt, fetchRowWiseVal);
cnt++;
}
}
filtrdJsn.put(entry.getKey(), dataJsnObj);
//if (dataJsnObj.toString().length() > 5)
filterdDataMap.put(entry.getKey(), filtrdJsn);
}
if (fltrDtlList.size() == count)
{
dataJsnObj.put("" + cnt, fetchRowWiseVal);
cnt++;
}
}
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*/
......
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