Commit 2fb7134a authored by sbade's avatar sbade

Added parent axis facility to set the axis of graph and in metadataDtl added...

Added parent axis facility to set the axis of graph and in metadataDtl added parent axis list to store the data for parent axis data.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@36700 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 79921ac2
......@@ -7,8 +7,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import sun.java2d.loops.RenderLoops;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
......@@ -78,6 +76,11 @@ public class ChartCreator
/*Added by Dhanendra */
String componentIconName = "";
/*Ended by Dhanendra */
/*Added by Swati on 31-07-15*/
List<String> parentAxisList=new ArrayList<String>();
/*Ended by Swati on 31-07-15*/
for (int i = 0; i < graphDtlList.size(); i++)
{
if (i == 3)
......@@ -164,6 +167,12 @@ public class ChartCreator
componentIconName = ""+graphDtlList.get(i);
}
/*add By Dhanendra for New Matadata Attribute*/
/*add By Swati for Parent Axis Attribute*/
if (i == 23)
{
parentAxisList = (ArrayList<String>)graphDtlList.get(i);
}
/*end By Swati for Parent Axis Attribute*/
}
int cnt=0;
if (jsonObjGraph != null)
......@@ -259,12 +268,30 @@ public class ChartCreator
if ("column".equals(renderInfoList.get(seriesCnt)))
{
barMap.put(new JSONString("renderas"), new JSONString("Column"));
barMap.put(new JSONString("parentYAxis"), new JSONString("s"));
/*Added Code for Parent Axis By Dhanendra */
if(parentAxisList.size()>0)
{
barMap.put(new JSONString("parentYAxis"), new JSONString(parentAxisList.get(seriesCnt)));
}
else
{
barMap.put(new JSONString("parentYAxis"), new JSONString("S"));
}
/*Added Code for Parent Axis By Dhanendra */
}
if ("line".equals(renderInfoList.get(seriesCnt)))
{
barMap.put(new JSONString("renderas"), new JSONString("Line"));
barMap.put(new JSONString("parentYAxis"), new JSONString("s"));
/*Added Code for Parent Axis By Dhanendra */
if(parentAxisList.size()>0)
{
barMap.put(new JSONString("parentYAxis"), new JSONString(parentAxisList.get(seriesCnt)));
}
else
{
barMap.put(new JSONString("parentYAxis"), new JSONString("S"));
}
/*Added Code for Parent Axis By Dhanendra */
barMap.put(new JSONString("valuePosition"), new JSONString("ABOVE"));
}
else
......@@ -369,13 +396,12 @@ public class ChartCreator
}
if(chartTypeList.get(0).trim().equals("stack"))
{
int count=0;
//HashMap<String, String> dMap = new HashMap<String, String>();
int count = 0;
for (String keyString : valueMapSet)
{
count++;
mapValuList = allDataMap.get(keyString);
jsnStringKey = new JSONString("label");
dataStringKey = new JSONString("value");
String value = mapValuList.get(1).replace("{", "");
......@@ -383,7 +409,6 @@ public class ChartCreator
String[] tempArray = value.split(",");
barMap = new LinkedHashMap<JSONValue, JSONValue>();
barValueList = new ArrayList<LinkedHashMap<JSONValue, JSONValue>>();
for(int i=0;i<tempArray.length;i++)
{
if(! tempArray[i].equals(""))
......@@ -412,11 +437,15 @@ public class ChartCreator
}
}
barMap.put(new JSONString("seriesname"), new JSONString(mapValuList.get(0)));
if(renderInfoList.contains("line")){
if(count==renderInfoList.size() || count==(renderInfoList.size()-1) ){
barMap.put(new JSONString("renderas"), new JSONString("Line"));
}
}
if(renderInfoList.contains("line"))
{
if(count==renderInfoList.size() || count==(renderInfoList.size()-1) )
{
barMap.put(new JSONString("renderas"), new JSONString("Line"));
}
}
barDataVal = JSONParser.parseStrict(barValueList.toString().replace('=', ':'));
barMap.put(new JSONString("data"), barDataVal);
allDataList.add(barMap);
......@@ -424,7 +453,7 @@ public class ChartCreator
}
categryDataVal = JSONParser.parseStrict(labelList.toString().replace('=', ':'));
categryJson.put("category", categryDataVal);
graphJson.put("categories", categryJson);
graphJson.put("categories", categryJson);
}
/**Start of Linked chart logic by swati dates: 22 December 2014 **/
......
......@@ -116,6 +116,10 @@ public class MetaDataDtl
String linkedMetadataName = "";
String linkTypeName = "";
//end on 20dec2014 by swati for linkedchart
/*Add Veriable for Parent Axis */
String parentAxisName="";
ArrayList<String> parentAxisList = null;
/*End Veriable for Parent Axis */
//add on dated 9 july 201041
Node chartPropertyNode = null;
NodeList chartPropertyNodeList = null;
......@@ -447,7 +451,9 @@ public class MetaDataDtl
linkedMetadataList = new ArrayList<String>();
linkTypeList = new ArrayList<String>();
//ended by swati 20dec2014 for linked chart
/*Added By Swati for parent axis */
parentAxisList= new ArrayList<String>();
/*Ended By Swati for parent axis */
/* Add By Dhanedra for metadata change */
groupTypeList = new ArrayList<String>();
componentCssList = new ArrayList<String>();
......@@ -456,7 +462,7 @@ public class MetaDataDtl
groupFltrNameList = new ArrayList<String>();
String componentIconName = "";
/* End By Dhanedra for metadata change */
metaDataMap = new LinkedHashMap<JSONString, JSONString>();
toolTextInfoList = new ArrayList<String>();
for (int i = 0; i < graphNodeList.getLength(); i++)
......@@ -467,7 +473,6 @@ public class MetaDataDtl
if ("column_group".equalsIgnoreCase(childNodeName))
{
attributeName = graphDataNode.getAttributes().getNamedItem("id").getNodeValue();
if ("x_axis".equalsIgnoreCase(attributeName))
{
xAxsisNodeList = graphDataNode.getChildNodes();
......@@ -518,17 +523,12 @@ public class MetaDataDtl
yAxisColumnName.add(columnNode.getChildNodes().item(0).getNodeValue());
renderDtl = columnNode.getAttributes().getNamedItem("render").getNodeValue();
renderInfoList.add(renderDtl);
showValDtl = columnNode.getAttributes().getNamedItem("showvalue").getNodeValue();
showValList.add(showValDtl);
colorDtl = columnNode.getAttributes().getNamedItem("color").getNodeValue();
colorInfoList.add(colorDtl);
/*
* add code for
* Tooltext by
* Dhanendra On
* 30-06-15
* add code for* Tooltext by Dhanendra On 30-06-15
*/
if (columnNode.getAttributes().getNamedItem("tooltext") != null)
{
......@@ -536,10 +536,7 @@ public class MetaDataDtl
toolTextInfoList.add(tooltextDtl);
}
/*
* End code for
* Tooltext by
* Dhanendra On
* 30-06-15
* End code for Tooltext by Dhanendra On 30-06-15
*/
if (columnNode.getAttributes().getNamedItem("linevisibility") != null)
{
......@@ -564,12 +561,22 @@ public class MetaDataDtl
linkTypeName = columnNode.getAttributes().getNamedItem("linktype").getNodeValue();
linkTypeList.add(linkTypeName);
//added linked chart metadata name to graphdetail list by swati on 24 Dec 2014
//added parent-axis to render column by swati on 31 July 2015
if (columnNode.getAttributes().getNamedItem("parentaxis") != null)
{
parentAxisName = columnNode.getAttributes().getNamedItem("parentaxis").getNodeValue();
parentAxisList.add(parentAxisName);
}
//ended parent-axis to render column by swati on 31 July 2015
}
/*if (flag.equals("false"))
{
metaDataMap.put(new JSONString("lineAlpha"), new JSONString("1"));
metaDataMap.put(new JSONString("anchorBorderThickness"), new JSONString("3"));
}*/
/*
* if (flag.equals("false"))
{
metaDataMap.put(new JSONString("lineAlpha"), new JSONString("1"));
metaDataMap.put(new JSONString("anchorBorderThickness"), new JSONString("3"));
}
*/
}
//Window.alert("metaDataMap: "+metaDataMap);
//added by swati "placevaluesinside": "1",rotatevalues
......@@ -788,24 +795,14 @@ public class MetaDataDtl
}
}
}
/*
* End Add new metadata tag for
* Compliance Report by Dhanendra on
* 25May2015
*/
/* End Add new metadata tag for Compliance Report by Dhanendra on 25May2015 */
/*
* Add componentIcon tag in metadata
* by Dhanendra on 01-07-2015
*/
/* Add componentIcon tag in metadata by Dhanendra on 01-07-2015 */
if ("component_icon".equalsIgnoreCase(childNodeName))
{
componentIconName = (graphDataNode.getChildNodes().item(0).getNodeValue());
}
/*
* End componentIcon tag in metadata
* by Dhanendra on 01-07-2015
*/
/* End componentIcon tag in metadata by Dhanendra on 01-07-2015 */
}
metaDataList.add(metaDataMap.toString().replace('=', ':'));
......@@ -825,32 +822,25 @@ public class MetaDataDtl
graphDtlList.add(linkedProperties);
graphDtlList.add(linkTypeList);
//ended linked chart metadata name to graphdetail list by swati on 22 Dec 2014
/*
* Add Group to graphdetail list by
* Dhanendra on 25 May 2015
*/
/* Add Group to graphdetail list by Dhanendra on 25 May 2015 */
graphDtlList.add(groupTypeList);
graphDtlList.add(componantTitlList);
graphDtlList.add(componentCssList);
graphDtlList.add(groupFltrNameList);
/*
* Ended Group to graphdetail list by
* Dhanendra on 25 May 2015
*/
/* Ended Group to graphdetail list by Dhanendra on 25 May 2015 */
/* Add For ToolText By Dhanendra */
graphDtlList.add(toolTextInfoList);
/* End For ToolText By Dhanendra */
/*
* Add For componentIcon By Dhanendra on
* 01-07-15
*/
/* Add For componentIcon By Dhanendra on 01-07-15*/
graphDtlList.add(componentIconName);
/*
* End For componentIcon By Dhanendra on
* 01-07-15
*/
/*Add for Parent Axis by Swati */
graphDtlList.add(parentAxisList);
/*End for Parent Axis by Swati */
conuter++;
gridNGraphMeataDataMap.put("type" + graphID, typeGraphMap);
graphMeataDataMap.put("graph" + conuter, graphDtlList);
......@@ -975,15 +965,8 @@ public class MetaDataDtl
metaDataMap.put(jsnStringKey, dataStringValue);
}
/*
* if
* ("legendpadding".equals
* (chartPropertyNode
* .getNodeName())) {
* dataStringValue = new
* JSONString
* (chartPropertyNode
* .getChildNodes
* ().item(0).getNodeValue
* if ("legendpadding".equals(chartPropertyNode.getNodeName())) {
* dataStringValue = new JSONString (chartPropertyNode.getChildNodes().item(0).getNodeValue
* ()); jsnStringKey = new
* JSONString
* ("legendpadding");
......@@ -1802,7 +1785,7 @@ public class MetaDataDtl
if ("filters".equals(rootNode.getNodeName()))
{
filtrNodeList = rootNode.getChildNodes();
for (int fltrCtr = 0; fltrCtr < filtrNodeList.getLength(); fltrCtr++)
{
fltrDtlNodeList = filtrNodeList.item(fltrCtr).getChildNodes();
......@@ -1894,6 +1877,7 @@ public class MetaDataDtl
}
fltrDtlList.add(filterInfo);
}
}
}
}
......
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