Foros del Web » Programación para mayores de 30 ;) » Programación General »

XML grafica

Estas en el tema de XML grafica en el foro de Programación General en Foros del Web. hola que tal. Estoy haciendo una grafica, pero no me estamandando correctamente bien los datos Lo que estoy haciendo es contar todos los registros que ...
  #1 (permalink)  
Antiguo 24/07/2009, 13:10
 
Fecha de Ingreso: febrero-2009
Mensajes: 142
Antigüedad: 15 años, 3 meses
Puntos: 0
XML grafica

hola que tal.

Estoy haciendo una grafica, pero no me estamandando correctamente bien los datos

Lo que estoy haciendo es contar todos los registros que hay en la bD de acuerdo al nse pero me muestra en la graficas todos los nse (Nivel Socioeconomico) y solo tengo registrados 3, tengo lo siguiente:

strPath = "C://Documents and Settings//DOT//Mis documentos//alicia//SD//web//Gallery//Data//audiencia.xml";
//strPath = "../../home/dot/public_html/SD/Gallery/Data//audiencia.xml";


File file2= new File(strPath);
fos = new FileOutputStream(file2);
dos=new DataOutputStream(fos);
pos= new PrintStream(fos);


pos.println("<?xml version='1.0' encoding='utf-8'?>");
pos.println("<chart caption='Audiencia' showSum='1' shownames='1' showvalues='0' numberPrefix='' " +
"sYAxisValuesDecimals='2' connectNullData='0' PYAxisName='# Notas' " +
"SYAxisName='' numDivLines='4' formatNumberScale='0'>");


pos.println("<categories>");
r_paisciudad.beforeFirst();
while(r_paisciudad.next()){
pos.println("<category label='" + r_paisciudad.getString(pdescpaisciudad) + "'/>");
int_maxpaisciudad++;
}

pos.println("</categories>");

r_paisciudad.beforeFirst();


strQry = "SELECT * from cat_nse";
// System.out.println(strQry);

r_nse = stmtnse.executeQuery(strQry);

int_i =0;
//r_medio = stmtmedio.executeQuery(strMedio);
while(r_nse.next()){
pos.println("<dataset seriesName='" + r_nse.getString("cv_nse") + "' color='" + colores[int_i] + "' showValues='0'>");
r_paisciudad.beforeFirst();
while(r_paisciudad.next()){
strQry ="SELECT count(m.id_monitoreo) as espacio, m." + pid_paisciudad + ", n.cv_nse from tbl_monitoreo m " +
"INNER JOIN cat_tipomedio tm ON (m.id_tipomedio = tm.id_tipomedio) " +
"INNER JOIN tbl_caractrevper p ON (p.id_tipomedio = m.id_tipomedio and p.id_medio = m.id_medio and p.id_seccion = m.id_seccion) " +
"INNER JOIN cat_nse n ON (n.id_nse = p.id_nse) " +
"where m." + pid_paisciudad + " = " + r_paisciudad.getInt(pid_paisciudad) + " and m.d_fechacaptura >= '" +
request.getParameter("fechainicial") + "' " +
"and m.d_fechacaptura <= '" + request.getParameter("fechafinal") + "' " +
" group by m." + pid_paisciudad + ", n.cv_nse UNION " +
//Internet
"SELECT count(m.id_monitoreo) as espacio, m." + pid_paisciudad + ", n.cv_nse from tbl_monitoreointernet m " +
"INNER JOIN tbl_internet p ON (p.id_tipositio = m.id_tipositio and p.id_sitio = m.id_sitio) " +
"INNER JOIN cat_nse n ON (n.id_nse = p.id_nse) " +"where m." + pid_paisciudad + " = " + r_paisciudad.getInt(pid_paisciudad) + " and m.d_fechacaptura >= '" +
request.getParameter("fechainicial") + "' " +
"and m.d_fechacaptura <= '" + request.getParameter("fechafinal") + "' " +
" group by m." + pid_paisciudad + ", n.cv_nse UNION "+

//Radio
"SELECT count(m.id_monitoreo) as espacio, m." + pid_paisciudad + ", n.cv_nse from tbl_monitoreoradio m " +
"INNER JOIN tbl_caractradio p ON (p.id_radiofonico = m.id_radiofonico and p.id_estacion = m.id_estacion and p.id_frecuenciaradio = m.id_frecuenciaradio " +
" and p.id_np = m.id_np and p.id_npradio = m.id_npradio ) " +
"INNER JOIN cat_nse n ON (n.id_nse = p.id_nse) " +"where m." + pid_paisciudad + " = " + r_paisciudad.getInt(pid_paisciudad) + " and m.d_fechacaptura >= '" +
request.getParameter("fechainicial") + "' " +
"and m.d_fechacaptura <= '" + request.getParameter("fechafinal") + "' " +
" group by m." + pid_paisciudad + ", n.cv_nse UNION " +
//TV
"SELECT count(m.id_monitoreo) as espacio, m." + pid_paisciudad + ", n.cv_nse from tbl_monitoreotv m " +
"INNER JOIN tbl_caracttv p ON (p.id_televisora = m.id_televisora and p.id_canal = m.id_canal and p.id_np = m.id_np " +
" and p.id_nptv = m.id_nptv) " +
"INNER JOIN cat_nse n ON (n.id_nse = p.id_nse) " +"where m." + pid_paisciudad + " = " + r_paisciudad.getInt(pid_paisciudad) + " and m.d_fechacaptura >= '" +
request.getParameter("fechainicial") + "' " +
"and m.d_fechacaptura <= '" + request.getParameter("fechafinal") + "' " +
" group by m." + pid_paisciudad + ", n.cv_nse " ;

System.out.println("nse= " + strQry);
r_datos = stmtdatos.executeQuery(strQry);

if(r_datos.next()){
pos.println("<set value='"+ r_datos.getString("espacio") +"'/>");
//int_countpaisciudad++;
}else{
pos.println("<set value='0'/>");
}
}
/*
for(int i = int_countpaisciudad; i< int_maxpaisciudad;i++){
pos.println("<set value='0'/>");
} */
int_i++;
//int_countpaisciudad = 0;
pos.println("</dataset>");
}

pos.print("</chart>");
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:26.