Commit cbe6ac01 authored by dkasliwal's avatar dkasliwal

Add code for new development of Bubble chart using chart.js API


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104441 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2490112d
......@@ -1780,6 +1780,27 @@ public class MetaDataDtl
}
//*** End Start Code for HTML Gauge Chart (Added by sachin on 18-08-15)*****\\
/*Add New Bubble Chart using Chart.js by Dhanendra on date 16-01-17*/
if ("component".equals(viewNode.getNodeName()) && type.equalsIgnoreCase("BUBBLE"))
{
CommonUtils.printOnConsole("********** In BUBBLE************* ");
graphMeataDataMap = new HashMap<String, ArrayList<Object>>();
typeGraphMap = new LinkedHashMap<String, String>();
graphDataSourceMap = new LinkedHashMap<String, String>();
graphID = viewNode.getAttributes().getNamedItem("id").getNodeValue();
type = viewNode.getAttributes().getNamedItem("type").getNodeValue();
dataSource = viewNode.getAttributes().getNamedItem("datasource").getNodeValue();
graphDataSourceMap.put("datasource" + graphID, dataSource);
typeGraphMap.put("type" + graphID, type);
graphNodeList = viewNode.getChildNodes();
conuter++;
gridNGraphMeataDataMap.put("type" + graphID, typeGraphMap);
graphMeataDataMap.put("graph" + conuter, this.getBubbleDataList(graphNodeList));
gridNGraphMeataDataMap.put(graphID, graphMeataDataMap);
gridNGraphMeataDataMap.put("datasource" + graphID, graphDataSourceMap);
}
/*End New Bubble Chart using Chart.js by Dhanendra on date 16-01-17*/
}
}
......@@ -2269,4 +2290,119 @@ public class MetaDataDtl
return graphDtlList;
}
/* End Added New Method By sachin For Gauge Cahrt on 18 Aug 15 */
/*Add New Bubble Chart using Chart.js by Dhanendra on date 16-01-17*/
private ArrayList<Object> getBubbleDataList(NodeList graphNodeList)
{
ArrayList<String> dataList = new ArrayList<String>();
ArrayList<String> labelList = new ArrayList<String>();
ArrayList<Object> graphDtlList = new ArrayList<Object>();
NodeList groupFilterNodeList = null;
NodeList columNodeList = null;
Node groupFilterNode = null;
Node graphDataNode = null;
String componentTitle = "";
String componentIcon = "";
String childNodeName = "";
String componentCss = "";
Node columnNode = null;
String data = "";
String height = "";
String width = "";
String caption = "";
String bgColor = "";
for (int i = 0; i < graphNodeList.getLength(); i++)
{
graphDataNode = graphNodeList.item(i);
childNodeName = graphDataNode.getNodeName();
if ("ComponentTitle".equalsIgnoreCase(childNodeName))
{
componentTitle = graphDataNode.getChildNodes().item(0).getNodeValue();
}
if ("component_css".equalsIgnoreCase(childNodeName))
{
componentCss = graphDataNode.getChildNodes().item(0).getNodeValue();
}
if ("component_icon".equalsIgnoreCase(childNodeName))
{
componentIcon = graphDataNode.getChildNodes().item(0).getNodeValue();
}
if ("chart_properties".equalsIgnoreCase(childNodeName))
{
groupFilterNodeList = graphDataNode.getChildNodes();
for (int j = 0; j < groupFilterNodeList.getLength(); j++)
{
groupFilterNode = groupFilterNodeList.item(j);
if ("height".equals(groupFilterNode.getNodeName()))
{
height = groupFilterNode.getChildNodes().item(0).getNodeValue();
}
if ("width".equals(groupFilterNode.getNodeName()))
{
width = groupFilterNode.getChildNodes().item(0).getNodeValue();
}
if ("caption".equals(groupFilterNode.getNodeName()))
{
caption = groupFilterNode.getChildNodes().item(0).getNodeValue();
}
if ("bg_color".equals(groupFilterNode.getNodeName()))
{
bgColor = groupFilterNode.getChildNodes().item(0).getNodeValue();
}
}
}
if (("column_group".equalsIgnoreCase(childNodeName)) && (null) != graphDataNode.getAttributes().getNamedItem("id") && "label".equals(graphDataNode.getAttributes().getNamedItem("id").getNodeValue()))
{
groupFilterNodeList = graphDataNode.getChildNodes();
for (int j = 0; j < groupFilterNodeList.getLength(); j++)
{
groupFilterNode = groupFilterNodeList.item(j);
columNodeList = groupFilterNode.getChildNodes();
for (int k = 0; k < columNodeList.getLength(); k++)
{
columnNode = columNodeList.item(k);
data = columnNode.getAttributes().getNamedItem("id").getNodeValue();
labelList.add(data);
}
}
}
if (("column_group".equalsIgnoreCase(childNodeName)) && (null) != graphDataNode.getAttributes().getNamedItem("id") && "data".equals(graphDataNode.getAttributes().getNamedItem("id").getNodeValue()))
{
groupFilterNodeList = graphDataNode.getChildNodes();
for (int j = 0; j < groupFilterNodeList.getLength(); j++)
{
groupFilterNode = groupFilterNodeList.item(j);
columNodeList = groupFilterNode.getChildNodes();
for (int k = 0; k < columNodeList.getLength(); k++)
{
columnNode = columNodeList.item(k);
data = columnNode.getAttributes().getNamedItem("id").getNodeValue();
dataList.add(data);
}
}
}
}
graphDtlList.add(componentTitle);
graphDtlList.add(componentCss);
graphDtlList.add(height);
graphDtlList.add(width);
graphDtlList.add(caption);
graphDtlList.add(bgColor);
graphDtlList.add(componentIcon);
graphDtlList.add(labelList);
graphDtlList.add(dataList);
CommonUtils.printOnConsole("******** graphDtlList ******** :"+graphDtlList);
return graphDtlList;
}
/*End New Bubble Chart using Chart.js by Dhanendra on date 16-01-17*/
}
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