Commit 910e383d authored by abibave's avatar abibave

Changes for new prototype in Plan Vs Actual Dashboard


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104479 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bdd83ac5
...@@ -1213,11 +1213,15 @@ public class GraphComponent extends Composite ...@@ -1213,11 +1213,15 @@ public class GraphComponent extends Composite
{ {
for (String graphNo : graphDataMap.keySet()) for (String graphNo : graphDataMap.keySet())
{ {
//RootPanel.get("chartContainer"+componentId).clear();
graphDtlList = graphDataMap.get(graphNo); graphDtlList = graphDataMap.get(graphNo);
Tree tree = new TreeBuilder().buildTree(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList); Tree tree = new TreeBuilder().buildTree(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList);
//RootPanel.get("chartContainer"+componentId).add(panel); CommonUtils.printOnConsole("graphDtlList"+graphDtlList);
String treeHeight = graphDtlList.get(3).toString();
String treeWidth = graphDtlList.get(4).toString();
treeHeight = treeHeight.substring(treeHeight.indexOf("[")+1, treeHeight.indexOf("]"));
treeWidth = treeWidth.substring(treeWidth.indexOf("[")+1, treeWidth.indexOf("]"));
tree.setSize(treeWidth, treeHeight);
tree.setStyleName("gwtTree");
componantTitlNameList = new ArrayList<String>(); componantTitlNameList = new ArrayList<String>();
groupCssTypeNameList = new ArrayList<String>(); groupCssTypeNameList = new ArrayList<String>();
componantTitlNameList = (ArrayList<String>) graphDtlList.get(1); componantTitlNameList = (ArrayList<String>) graphDtlList.get(1);
......
package ibase.client; package ibase.client;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import com.google.gwt.json.client.JSONArray; import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject; import com.google.gwt.json.client.JSONObject;
import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HTML;
...@@ -18,35 +22,35 @@ public class TreeBuilder { ...@@ -18,35 +22,35 @@ public class TreeBuilder {
JSONObject categoryRowWiseVal = null; JSONObject categoryRowWiseVal = null;
JSONArray docList = null; JSONArray docList = null;
StringBuffer buffer = null; StringBuffer buffer = null;
HashMap<String, ArrayList<String>> localityMap = null;
for (int jsnCnt = 0; jsnCnt < jsonObjFrGraph.size(); jsnCnt++) for (int jsnCnt = 0; jsnCnt < jsonObjFrGraph.size(); jsnCnt++)
{ {
categoryRowWiseVal = (JSONObject) jsonObjFrGraph.get(""+jsnCnt); categoryRowWiseVal = (JSONObject) jsonObjFrGraph.get(""+jsnCnt);
String eventDate = "" + categoryRowWiseVal.get("eventdate").toString().replace("\"", ""); String eventDate = "" + categoryRowWiseVal.get("eventdate").toString().replace("\"", "");
fetchRowWiseVal = (JSONObject) categoryRowWiseVal.get("category"); fetchRowWiseVal = (JSONObject) categoryRowWiseVal.get("category");
TreeItem eventDateItem = new TreeItem(eventDate); //TreeItem eventDateItem = new TreeItem(eventDate);
/*TreeItem eventDateItem = new TreeItem(); TreeItem eventDateItem = new TreeItem();
eventDateItem.setText(eventDate);*/ eventDateItem.setText(eventDate);
TreeItem planItem = new TreeItem("Planned"); //TreeItem planItem = new TreeItem("Planned-Met");
/*TreeItem planItem = new TreeItem(); TreeItem planItem = new TreeItem();
planItem.setText("Plan");*/ planItem.setText("Planned-Met");
eventDateItem.addItem(planItem); eventDateItem.addItem(planItem);
TreeItem missedItem = new TreeItem("Missed-Planned"); //TreeItem missedItem = new TreeItem("Missed-Planned");
/*TreeItem missedItem = new TreeItem(); TreeItem missedItem = new TreeItem();
missedItem.setText("Missed");*/ missedItem.setText("Missed-Planned");
eventDateItem.addItem(missedItem); eventDateItem.addItem(missedItem);
TreeItem unplanItem = new TreeItem("Unplanned"); //TreeItem unplanItem = new TreeItem("Unplanned-Met");
/*TreeItem unplanItem = new TreeItem(); TreeItem unplanItem = new TreeItem();
unplanItem.setText("Unplan");*/ unplanItem.setText("Unplanned-Met");
eventDateItem.addItem(unplanItem); eventDateItem.addItem(unplanItem);
if(!"null".equalsIgnoreCase(""+fetchRowWiseVal.get("plan"))) if(!"null".equalsIgnoreCase(""+fetchRowWiseVal.get("plan")))
{ {
docList = (JSONArray) fetchRowWiseVal.get("plan"); docList = (JSONArray) fetchRowWiseVal.get("plan");
String locality = "";
localityMap = new HashMap<String, ArrayList<String>>();
if(docList.size() > 0){ if(docList.size() > 0){
buffer = new StringBuffer("<table border='1' class='cardHtmlTable' width='93%' cellpadding='4'><tr><td style='text-align: left;'>Doctor Name</td><td style='text-align: left;'>Speciality</td><td style='text-align: left;'>Location</td></tr>");
for (int i = 0; i < docList.size(); i++) for (int i = 0; i < docList.size(); i++)
{ {
//TreeItem docNameItem = new TreeItem(""+docList.get(i).toString().replace("\"", "")); //TreeItem docNameItem = new TreeItem(""+docList.get(i).toString().replace("\"", ""));
...@@ -54,9 +58,36 @@ public class TreeBuilder { ...@@ -54,9 +58,36 @@ public class TreeBuilder {
docNameItem.setText(""+docList.get(i).toString().replace("\"", "")); docNameItem.setText(""+docList.get(i).toString().replace("\"", ""));
planItem.addItem(docNameItem);*/ planItem.addItem(docNameItem);*/
String docData[]= (docList.get(i).toString().replace("\"", "")).split("@"); String docData[]= (docList.get(i).toString().replace("\"", "")).split("@");
buffer.append("<tr><td style='text-align: left;'>"+docData[0]+"</td><td style='text-align: left;'>"+docData[1]+"</td><td style='text-align: left;'>"+docData[2]+"</td></tr>"); locality = docData[2];
ArrayList<String> locList = null;
if(localityMap.containsKey(locality))
{
locList = localityMap.get(locality);
locList.add(docData[0]+"@"+docData[1]);
localityMap.put(locality, locList);
} }
buffer.append("</table"); else{
locList = new ArrayList<String>();
locList.add(docData[0]+"@"+docData[1]);
localityMap.put(locality, locList);
}
//buffer.append("<tr><td style='text-align: left;'>"+docData[0]+"</td><td style='text-align: left;'>"+docData[1]+"</td><td style='text-align: left;'>"+docData[2]+"</td></tr>");
}
buffer = new StringBuffer("<table border='0' width='98%'><tbody>");
for (Entry<String, ArrayList<String>> entry : localityMap.entrySet()) {
String location = entry.getKey();
ArrayList<String> locationData = entry.getValue();
buffer.append("<tr> <td colspan='4' class= 'cardSalesPersonTitle'> <table border='0' width='100%'> <tr> <td align = 'left'>"+location+"</td> </tr> </table> </td> </tr>");
for (Iterator<String> iterator = locationData.iterator(); iterator.hasNext();) {
String locationwiseData = (String) iterator.next();
String locData[]= locationwiseData.split("@");
String docNameImageStr = locData[0];
String docData[]= docNameImageStr.split("~");
String time = "10.30 am";
buffer.append("<tr><td> <table border='0' width='100%' cellspacing= '5'> <tr> <td rowspan = '2' width='1%'>"+docData[1]+"</td> <td width = '35%' align = 'left'> "+docData[0]+" @ "+time+" </td></tr> <tr> <td align = left> "+locData[1]+"</td> </tr> </table> </td> </tr>");
}
}
buffer.append("</tbody></table");
HTML html = new HTML(); HTML html = new HTML();
html.setHTML(buffer.toString()); html.setHTML(buffer.toString());
planItem.addItem(html); planItem.addItem(html);
...@@ -71,8 +102,11 @@ public class TreeBuilder { ...@@ -71,8 +102,11 @@ public class TreeBuilder {
if(!"null".equalsIgnoreCase(""+fetchRowWiseVal.get("missed"))) if(!"null".equalsIgnoreCase(""+fetchRowWiseVal.get("missed")))
{ {
docList = (JSONArray) fetchRowWiseVal.get("missed"); docList = (JSONArray) fetchRowWiseVal.get("missed");
String locality = "";
localityMap = new HashMap<String, ArrayList<String>>();
if(docList.size() > 0){ if(docList.size() > 0){
buffer = new StringBuffer("<table border='1' class='cardHtmlTable' width='93%' cellpadding='4'><tr><td style='text-align: left;'>Doctor Name</td><td style='text-align: left;'>Speciality</td><td style='text-align: left;'>Location</td></tr>"); //buffer = new StringBuffer("<table border='1' class='cardHtmlTable' width='93%' cellpadding='4'><tr><td style='text-align: left;'>Doctor Name</td><td style='text-align: left;'>Speciality</td><td style='text-align: left;'>Location</td></tr>");
for (int i = 0; i < docList.size(); i++) for (int i = 0; i < docList.size(); i++)
{ {
//TreeItem docNameItem = new TreeItem(""+docList.get(i).toString().replace("\"", "")); //TreeItem docNameItem = new TreeItem(""+docList.get(i).toString().replace("\"", ""));
...@@ -80,9 +114,36 @@ public class TreeBuilder { ...@@ -80,9 +114,36 @@ public class TreeBuilder {
docNameItem.setText(""+docList.get(i).toString().replace("\"", "")); docNameItem.setText(""+docList.get(i).toString().replace("\"", ""));
missedItem.addItem(docNameItem);*/ missedItem.addItem(docNameItem);*/
String docData[]= (docList.get(i).toString().replace("\"", "")).split("@"); String docData[]= (docList.get(i).toString().replace("\"", "")).split("@");
buffer.append("<tr><td style='text-align: left;'>"+docData[0]+"</td><td style='text-align: left;'>"+docData[1]+"</td><td style='text-align: left;'>"+docData[2]+"</td></tr>"); locality = docData[2];
ArrayList<String> locList = null;
if(localityMap.containsKey(locality))
{
locList = localityMap.get(locality);
locList.add(docData[0]+"@"+docData[1]);
localityMap.put(locality, locList);
} }
buffer.append("</table"); else{
locList = new ArrayList<String>();
locList.add(docData[0]+"@"+docData[1]);
localityMap.put(locality, locList);
}
//buffer.append("<tr><td style='text-align: left;'>"+docData[0]+"</td><td style='text-align: left;'>"+docData[1]+"</td><td style='text-align: left;'>"+docData[2]+"</td></tr>");
}
buffer = new StringBuffer("<table border='0' width='98%'><tbody>");
for (Entry<String, ArrayList<String>> entry : localityMap.entrySet()) {
String location = entry.getKey();
ArrayList<String> locationData = entry.getValue();
buffer.append("<tr> <td colspan='4' class= 'cardSalesPersonTitle'> <table border='0' width='100%'> <tr> <td align = 'left'>"+location+"</td> </tr> </table> </td> </tr>");
for (Iterator<String> iterator = locationData.iterator(); iterator.hasNext();) {
String locationwiseData = (String) iterator.next();
String locData[]= locationwiseData.split("@");
String docNameImageStr = locData[0];
String docData[]= docNameImageStr.split("~");
String time = "10.30 am";
buffer.append("<tr><td> <table border='0' width='100%' cellspacing= '5'> <tr> <td rowspan = '2' width='1%'>"+docData[1]+"</td> <td width = '35%' align = 'left'> "+docData[0]+" @ "+time+" </td></tr> <tr> <td align = left> "+locData[1]+"</td> </tr> </table> </td> </tr>");
}
}
buffer.append("</tbody></table");
HTML html = new HTML(); HTML html = new HTML();
html.setHTML(buffer.toString()); html.setHTML(buffer.toString());
missedItem.addItem(html); missedItem.addItem(html);
...@@ -97,8 +158,10 @@ public class TreeBuilder { ...@@ -97,8 +158,10 @@ public class TreeBuilder {
if(!"null".equalsIgnoreCase(""+fetchRowWiseVal.get("unplan"))) if(!"null".equalsIgnoreCase(""+fetchRowWiseVal.get("unplan")))
{ {
docList = (JSONArray) fetchRowWiseVal.get("unplan"); docList = (JSONArray) fetchRowWiseVal.get("unplan");
String locality = "";
localityMap = new HashMap<String, ArrayList<String>>();
if(docList.size() > 0){ if(docList.size() > 0){
buffer = new StringBuffer("<table border='1' class='cardHtmlTable' width='93%' cellpadding='4'><tr><td style='text-align: left;'>Doctor Name</td><td style='text-align: left;'>Speciality</td><td style='text-align: left;'>Location</td></tr>");
for (int i = 0; i < docList.size(); i++) for (int i = 0; i < docList.size(); i++)
{ {
//TreeItem docNameItem = new TreeItem(""+docList.get(i).toString().replace("\"", "")); //TreeItem docNameItem = new TreeItem(""+docList.get(i).toString().replace("\"", ""));
...@@ -106,9 +169,36 @@ public class TreeBuilder { ...@@ -106,9 +169,36 @@ public class TreeBuilder {
docNameItem.setText(""+docList.get(i).toString().replace("\"", "")); docNameItem.setText(""+docList.get(i).toString().replace("\"", ""));
unplanItem.addItem(docNameItem);*/ unplanItem.addItem(docNameItem);*/
String docData[]= (docList.get(i).toString().replace("\"", "")).split("@"); String docData[]= (docList.get(i).toString().replace("\"", "")).split("@");
buffer.append("<tr><td style='text-align: left;'>"+docData[0]+"</td><td style='text-align: left;'>"+docData[1]+"</td><td style='text-align: left;'>"+docData[2]+"</td></tr>"); locality = docData[2];
ArrayList<String> locList = null;
if(localityMap.containsKey(locality))
{
locList = localityMap.get(locality);
locList.add(docData[0]+"@"+docData[1]);
localityMap.put(locality, locList);
} }
buffer.append("</table"); else{
locList = new ArrayList<String>();
locList.add(docData[0]+"@"+docData[1]);
localityMap.put(locality, locList);
}
//buffer.append("<tr><td style='text-align: left;'>"+docData[0]+"</td><td style='text-align: left;'>"+docData[1]+"</td><td style='text-align: left;'>"+docData[2]+"</td></tr>");
}
buffer = new StringBuffer("<table border='0' width='98%'><tbody>");
for (Entry<String, ArrayList<String>> entry : localityMap.entrySet()) {
String location = entry.getKey();
ArrayList<String> locationData = entry.getValue();
buffer.append("<tr> <td colspan='4' class= 'cardSalesPersonTitle'> <table border='0' width='100%'> <tr> <td align = 'left'>"+location+"</td> </tr> </table> </td> </tr>");
for (Iterator<String> iterator = locationData.iterator(); iterator.hasNext();) {
String locationwiseData = (String) iterator.next();
String locData[]= locationwiseData.split("@");
String docNameImageStr = locData[0];
String docData[]= docNameImageStr.split("~");
String time = "10.30 am";
buffer.append("<tr><td> <table border='0' width='100%' cellspacing= '5'> <tr> <td rowspan = '2' width='1%'>"+docData[1]+"</td> <td width = '35%' align = 'left'> "+docData[0]+" @ "+time+" </td></tr> <tr> <td align = left> "+locData[1]+"</td> </tr> </table> </td> </tr>");
}
}
buffer.append("</tbody></table");
HTML html = new HTML(); HTML html = new HTML();
html.setHTML(buffer.toString()); html.setHTML(buffer.toString());
unplanItem.addItem(html); unplanItem.addItem(html);
......
...@@ -1502,7 +1502,9 @@ color: #999; !important; ...@@ -1502,7 +1502,9 @@ color: #999; !important;
.cardSalesPersonTitle .cardSalesPersonTitle
{ {
height: 25px; height: 25px;
background-color: #808080; /* Commented by Aniket on 24/01/2017 as this color is used in Card Type
background-color: #808080; */
background-color: #f0eff5;
color:white; color:white;
width:2%; width:2%;
} }
...@@ -1883,3 +1885,34 @@ width:26%; ...@@ -1883,3 +1885,34 @@ width:26%;
width: 100% !important; width: 100% !important;
} }
/*End Css for bubble chart by dhanendra 18-01-17*/ /*End Css for bubble chart by dhanendra 18-01-17*/
/* Start CSS for Plan Vs Actual dashboard by Aniket on dated :23/01/2017*/
.defaultUserImg1
{
height: 27px;
width: 27px;
border-radius: 50%;
background: gray;
padding: 2px;
text-align: center;
color: white;
padding-top: 5px;
display: table;
}
.gwtTree
{
overflow: auto;
position: relative;
zoom: 1;
}
.cardProdImg1
{
border-radius: 50%;
/* margin-left: 5px; */
padding: 2px;
width: 32px;
height: 32px;
}
/* END CSS for Plan Vs Actual dashboard by Aniket on dated :23/01/2017*/
\ 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