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";
33
Hashtable htForIndicator = ViewChartBean.setIndicatorIDs();
34
Enumeration keysForIndicator = htForIndicator.keys();
37
String[] series1 = new String[htForIndicator.size()];
38
String[] series2 = new String[htForIndicator.size()];
40
while(keysForIndicator.hasMoreElements())
42
String keyI = (String) keysForIndicator.nextElement();
43
int iID = ((Integer)htForIndicator.get(keyI)).intValue();
44
series1[count] = keyI;
45
series2[count++]=keyI;
50
chartTitle += "\n Facility : "+ViewChartBean.getOrgUnitName()+"\nPeriod : "+ViewChartBean.getS_Date()+" To "+ViewChartBean.getE_Date();
54
Hashtable htForPeriods = ViewChartBean.setPeriodIDs();
55
//Enumeration keysForPeriod = htForPeriods.keys();
57
Vector vForPeriods = new Vector(htForPeriods.keySet());
58
Collections.sort(vForPeriods);
59
Iterator iteratorForPeriod = vForPeriods.iterator();
61
String[] categories1 = new String[htForPeriods.size()];
62
String[] categories2 = new String[htForPeriods.size()];
64
<tr><td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1" bordercolor="#111111">Indicator Name</td>
65
<td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1" bordercolor="#111111"><font color="Maroon">Target</font></td>
67
while(iteratorForPeriod.hasNext())
69
String keyP = (String) iteratorForPeriod.next();
70
int pID = ((Integer)htForPeriods.get(keyP)).intValue();
71
if(categoryType.equals("Period"))
73
String partsOfTempForSDate[] = keyP.split("-");
74
tempForSDate = monthNames[Integer.parseInt(partsOfTempForSDate[1])]+partsOfTempForSDate[0];
76
else tempForSDate = keyP;
78
categories1[count]=tempForSDate;
79
categories2[count++]=tempForSDate;
81
<td class="TableHeadingCellStyles"><%=tempForSDate%></td>
87
//Indicator Values & Target
89
Hashtable htForIndicatorValues = ViewChartBean.getValuesByPeriod();
90
if(htForIndicatorValues==null) {out.println("<h3>Select any Indicator</h3>");return;}
91
Enumeration keysForIndicatorValues = htForIndicatorValues.keys();
93
Hashtable htForTargets = ViewChartBean.getTargetValues();
98
double data1[][]= new double[htForIndicatorValues.size()][];
101
while(keysForIndicatorValues.hasMoreElements())
103
String keyIV = (String) keysForIndicatorValues.nextElement();
104
List liForValues = (ArrayList) htForIndicatorValues.get(keyIV);
105
data1[count1] = new double[liForValues.size()];
106
Iterator itForValues = liForValues.iterator();
109
<tr><td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1" bordercolor="#111111"><%=keyIV%></td>
110
<td class="TableDataCellStyles"><font color="Maroon"><%=((Double)htForTargets.get(keyIV)).doubleValue()%></font></td>
112
while(itForValues.hasNext())
114
double iValue = ((Double) itForValues.next()).doubleValue();
115
data1[count1][count2] = Math.round(iValue*Math.pow(10,2))/Math.pow(10,2);
118
<td class="TableDataCellStyles"><%=Math.round(iValue*Math.pow(10,2))/Math.pow(10,2)%></td>
121
}// list while loop end
128
/* Hashtable htForTargets = new Hashtable();
129
htForTargets.put("Percentage of first trimester ANC registration",new Double(60.0));
130
htForTargets.put("Percentage of Institutional Delivery",new Double(90.0));
131
htForTargets.put("Percentage of Delivery by SBA",new Double(95.0));
132
htForTargets.put("Percentage of Still Births",new Double(100.0));
133
htForTargets.put("Percentage of Female Live Birth",new Double(50.0));
134
htForTargets.put("Early Breast Feeding Rate",new Double(90.0));
135
htForTargets.put("Percentage of Fully Immunised Children",new Double(90.0));
136
htForTargets.put("Percentage of drop outs in BCG to Measles",new Double(10.0));
137
htForTargets.put("Percentage of LBW Children at Birth",new Double(10.0));
138
htForTargets.put("Infant Mortality Rate",new Double(50.0));
139
htForTargets.put("Percentage of Neonatal Deaths",new Double(25.0));
140
htForTargets.put("Total Sterilization Rate",new Double(65.0));
142
double data2[][]= new double[count1][count2];
145
while(count1<data2.length)
149
while(count2<data2[count1].length)
151
data2[count1][count2++]= ((Double)htForTargets.get(series1[count1])).doubleValue();
160
<jsp:useBean id="myChart" scope="request" class='org.hisp.gtool.charts.PieChart1' />
162
<jsp:setProperty name="myChart" property="section" value="<%=categories1%>"/>
163
<jsp:setProperty name="myChart" property="data" value="<%=data1[0]%>"/>
164
<jsp:setProperty name="myChart" property="chartTitle" value="<%=chartTitle%>"/>
167
myChart.setXAxis_Title(xAxisTitle);
168
myChart.setYAxis_Title(yAxisTitle);
171
<%String chartViewer = myChart.getChartViewer(request, response);%>
173
<img src="<%=chartViewer%>" border=0 usemap="#imageMap">
b'\\ No newline at end of file'