1 package transactions; 2 3 import dinamica.*; 4 5 15 public class TimeSeries extends GenericTransaction 16 { 17 18 21 public int service(Recordset inputParams) throws Throwable  22 { 23 24 int rc = super.service(inputParams); 25 26 Recordset x = new Recordset(); 27 x.append("date", java.sql.Types.DATE); 28 x.append("value", java.sql.Types.DOUBLE); 29 30 for (int i=0;i<6;i++) 31 { 32 33 java.util.Date d = null; java.util.Calendar c = java.util.Calendar.getInstance(); 35 c.add(java.util.Calendar.DATE,i+1); 36 d = c.getTime(); 37 Double dbl = new Double ((double)1000.00 + (i*2000)); 38 x.addNew(); 39 x.setValue("date",d); 40 x.setValue("value", dbl); 41 } 42 43 getSession().setAttribute("timeseries", x); 44 45 46 Recordset rs = getChartInfoRecordset(); 47 48 49 rs.addNew(); 50 rs.setValue("title", "Compras Anuales"); 51 rs.setValue("title-x", "D�a"); rs.setValue("title-y", "Monto en US$"); rs.setValue("column-x", "date"); 54 rs.setValue("column-y", "value"); rs.setValue("title-series", null); rs.setValue("width", new Integer (600)); rs.setValue("height", new Integer (400)); rs.setValue("data", "timeseries"); rs.setValue("dateformat", "dd-MM-yyyy"); 61 62 rs.setValue("chart-plugin", "dinamica.charts.VerticalBarChart3D"); 63 64 65 publish("chartinfo", rs); 66 67 return rc; 68 69 } 70 71 } 72
| Popular Tags
|