1
<%@ page import="java.sql.*,java.util.*" %>
2
<%@ page session="true"%>
4
<jsp:useBean id="ViewChartBean" scope="session" class="org.hisp.gtool.action.ViewChartBean" />
8
<title>Graphical Analyser</title>
9
<link rel="stylesheet" type="text/css" href="css/StylesForTags.css" />
13
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: dotted" bordercolor="#111111" width="100%">
17
String categoryType = ViewChartBean.getI_category();
18
String ideType = ViewChartBean.getIde_type();
20
String monthNames[]={"","Jan-","Feb-","Mar-","Apr-","May-","Jun-","Jul-","Aug-","Sep-","Oct-","Nov-","Dec-"};
21
String tempForSDate = "";
23
String chartTitle = "Indicator : ";
24
String xAxisTitle = "";
25
String yAxisTitle = "";
26
if(categoryType.equals("Period")) xAxisTitle = "Time Line";
27
else xAxisTitle = "Facilities";
29
if(ideType.equals("indicatorsRadio")) yAxisTitle="Percentage/Rate";
30
else yAxisTitle="Value";
34
Hashtable htForIndicator = ViewChartBean.setIndicatorIDs();
35
Enumeration keysForIndicator = htForIndicator.keys();
38
String[] series1 = new String[htForIndicator.size()];
39
String[] series2 = new String[htForIndicator.size()];
41
while(keysForIndicator.hasMoreElements())
43
String keyI = (String) keysForIndicator.nextElement();
44
int iID = ((Integer)htForIndicator.get(keyI)).intValue();
45
series1[count] = keyI;
46
series2[count++]=keyI;
51
chartTitle += "\n Facility : "+ViewChartBean.getOrgUnitName()+"\nPeriod : "+ViewChartBean.getS_Date()+" To "+ViewChartBean.getE_Date();
55
Hashtable htForPeriods = ViewChartBean.setPeriodIDs();
56
//Enumeration keysForPeriod = htForPeriods.keys();
58
Vector vForPeriods = new Vector(htForPeriods.keySet());
59
Collections.sort(vForPeriods);
60
Iterator iteratorForPeriod = vForPeriods.iterator();
62
String[] categories1 = new String[htForPeriods.size()];
63
String[] categories2 = new String[htForPeriods.size()];
65
<tr><td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1" bordercolor="#111111">Indicator Name</td>
66
<td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1" bordercolor="#111111"><font color="Maroon">Target</font></td>
68
while(iteratorForPeriod.hasNext())
70
String keyP = (String) iteratorForPeriod.next();
71
int pID = ((Integer)htForPeriods.get(keyP)).intValue();
72
if(categoryType.equals("Period"))
74
String partsOfTempForSDate[] = keyP.split("-");
75
tempForSDate = monthNames[Integer.parseInt(partsOfTempForSDate[1])]+partsOfTempForSDate[0];
77
else tempForSDate = keyP;
79
categories1[count]=tempForSDate;
80
categories2[count++]=tempForSDate;
82
<td class="TableHeadingCellStyles"><%=tempForSDate%></td>
88
//Indicator Values & Targets
90
Hashtable htForIndicatorValues = ViewChartBean.getValuesByPeriod();
91
if(htForIndicatorValues==null) {out.println("<h3>Select any Indicator</h3>");return;}
92
Enumeration keysForIndicatorValues = htForIndicatorValues.keys();
94
Hashtable htForTargets = ViewChartBean.getTargetValues();
99
double data1[][]= new double[htForIndicatorValues.size()][];
102
while(keysForIndicatorValues.hasMoreElements())
104
String keyIV = (String) keysForIndicatorValues.nextElement();
105
List liForValues = (ArrayList) htForIndicatorValues.get(keyIV);
106
data1[count1] = new double[liForValues.size()];
107
Iterator itForValues = liForValues.iterator();
110
<tr><td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1" bordercolor="#111111"><%=keyIV%></td>
111
<td class="TableDataCellStyles"><font color="Maroon"><%=((Double)htForTargets.get(keyIV)).doubleValue()%></font></td>
113
while(itForValues.hasNext())
115
double iValue = ((Double) itForValues.next()).doubleValue();
116
data1[count1][count2] = Math.round(iValue*Math.pow(10,2))/Math.pow(10,2);
119
<td class="TableDataCellStyles"><%=Math.round(iValue*Math.pow(10,2))/Math.pow(10,2)%></td>
122
}// list while loop end
131
/*Hashtable htForTargets = new Hashtable();
132
htForTargets.put("Percentage of first trimester ANC registration",new Double(60.0));
133
htForTargets.put("Percentage of Institutional Delivery",new Double(90.0));
134
htForTargets.put("Percentage of Delivery by SBA",new Double(95.0));
135
htForTargets.put("Percentage of Still Births",new Double(100.0));
136
htForTargets.put("Percentage of Female Live Birth",new Double(50.0));
137
htForTargets.put("Early Breast Feeding Rate",new Double(90.0));
138
htForTargets.put("Percentage of Fully Immunised Children",new Double(90.0));
139
htForTargets.put("Percentage of drop outs in BCG to Measles",new Double(10.0));
140
htForTargets.put("Percentage of LBW Children at Birth",new Double(10.0));
141
htForTargets.put("Infant Mortality Rate",new Double(50.0));
142
htForTargets.put("Percentage of Neonatal Deaths",new Double(25.0));
143
htForTargets.put("Total Sterilization Rate",new Double(65.0));*/
145
double data2[][]= new double[count1][count2];
148
while(count1<data2.length)
152
while(count2<data2[count1].length)
154
data2[count1][count2++]= ((Double)htForTargets.get(series1[count1])).doubleValue();
163
<jsp:useBean id="myChart" scope="request" class='org.hisp.gtool.charts.BarChart3D1' />
165
<jsp:setProperty name="myChart" property="series" value="<%=series1%>"/>
166
<jsp:setProperty name="myChart" property="categories" value="<%=categories1%>"/>
167
<jsp:setProperty name="myChart" property="data" value="<%=data1%>"/>
168
<jsp:setProperty name="myChart" property="data2" value="<%=data2%>"/>
170
<jsp:setProperty name="myChart" property="chartTitle" value="<%=chartTitle%>"/>
173
myChart.setXAxis_Title(xAxisTitle);
174
myChart.setYAxis_Title(yAxisTitle);
177
<%String chartViewer = myChart.getChartViewer(request, response);%>
179
<img src="<%=chartViewer%>" border=0 usemap="#imageMap">