Comunidad de diseño web y desarrollo en internet online

Crear un LineChart a partir de archivos TXT

Citar            
MensajeEscrito el 07 Oct 2008 10:55 am
Muy buenas a todos.

Soy un novato total en esto de Flex, pero estoy intentando aprender con la ayuda de los tutoriales, foros y demás. Tengo esta duda exactamente y no encuentro un "how to" para tontos donde pueda entender como hacerlo.

Tengo datos de valores en 3 archivos de texto diferentes y a partir de ellos, quiero hacer una gráfica de líneas. En el eje x, van valores horarios (00:00 - 23:00) y en el eje Y los valores que recojo de esos 3 archivos. El probelma es que no se ni como empezar desde 0. Decir que los archivos estan en local (donde estará la aplicacion web que mostrará las graficas).

Hasta ahora he dibujado (en modo Desingn) la gráfica con las 3 series que quiero dibujar y poco más. He mirado y remirado, pero no me queda claro que pasos debo seguir para recoger los datos (darles forma) y colocarlos en un array (supongo) y que se muestren en la gráfica.

¿alguna ayuda?
Un millón de gracias y felicidades por este estupendo foro.

Por mingole

10 de clabLevel



 

firefox
Citar            
MensajeEscrito el 10 Oct 2008 10:27 am
Ninguna ayuda?

No he consguido aún leer un archivo de texto y ponerlo siquiera en un TexArea ¿tan torpe soy?

Por mingole

10 de clabLevel



 

firefox
Citar            
MensajeEscrito el 10 Oct 2008 01:54 pm
tienes algun formato en el archivo de texto? has probado con XML??

Por master_of_puppetz

Claber

2483 de clabLevel

7 tutoriales
3 articulos

Genero:Masculino   Premio_Secretos

WebDev (Flex + PHP + JS)

safari
Citar            
MensajeEscrito el 13 Oct 2008 09:36 am
Hola, muchas gracias por la respuesta.

Este es el formato de los 3 archivos que debo leer. Como ves, tienen formato diferente, así como el tipo de valores son diferentes. En uno, los valores que tengo que representar, son cada hora y en otro, cada 2 minutos...Tengo que representar los de cada serie en un chart diferente.

Lo de probar con xml, en mi caso, los archivos que debo leer estan en el mismo servidor donde ejecuto la página web, por eso me es más comodo ir leyendo los datos directamente desde los archivos (que van cambiando cada 2 minutos).

Muchas gracias anticipadas.


ARCHIVO 1

================================
Cabecera

cabecera
================================
HORA 10 11 12 13 14 15 16 17
SERIE1 4 4 3 4 3 3 4 4
SERIE2 43 45 47 46 43 41 42 45
SERIE3 0 0 0 0 0 0 0 0
SERIE4 0 0 0 0 0 0 0 0
SERIE5 7 7 7 7 7 7 7 7
SERIE6 0 0 0 0 0 0 0 0
SERIE7 20 20 20 20 19 18 18 18

ARCHIVO 2

SERIE1 10:00 0.00
SERIE1 10:02 0.00
SERIE1 10:04 0.00
SERIE1 10:06 0.00
SERIE1 10:08 0.00
SERIE1 10:10 0.00
SERIE1 10:12 0.00
SERIE1 10:14 0.00
SERIE1 10:16 0.00
SERIE1 10:18 0.00
SERIE1 10:20 0.00
SERIE1 10:22 0.00
SERIE1 10:24 0.00
SERIE1 10:26 0.00
SERIE1 10:28 0.00
SERIE1 10:30 0.00
SERIE1 10:32 0.00
SERIE1 10:34 0.00
SERIE1 10:36 0.00
SERIE1 10:38 0.10
SERIE1 10:40 0.07
SERIE1 10:42 0.09
SERIE1 10:44 0.14
SERIE1 10:46 0.07
SERIE1 10:48 0.09
SERIE1 10:50 0.15
SERIE1 10:52 0.18
SERIE1 10:54 0.40
SERIE1 10:56 0.04
SERIE1 10:58 0.17
SERIE1 11:00 0.01
SERIE1 11:02 0.00
SERIE1 11:04 0.00
SERIE1 11:06 0.00
SERIE1 11:08 0.00
SERIE1 11:10 0.16
SERIE1 11:12 0.11
SERIE1 11:14 0.02
SERIE1 11:16 0.13
SERIE1 11:18 0.12
SERIE1 11:20 0.07
SERIE1 11:22 0.03
SERIE1 11:24 0.33
SERIE1 11:26 0.09
SERIE1 11:28 0.22
SERIE1 11:30 0.13
SERIE1 11:32 0.29
SERIE1 11:34 0.26
SERIE1 11:36 0.87
SERIE1 11:38 1.24
SERIE1 11:40 1.46
SERIE1 11:42 1.18
SERIE1 11:44 0.90
SERIE1 11:46 2.00
SERIE1 11:48 2.15
SERIE1 11:50 1.75
SERIE1 11:52 2.24
SERIE1 11:54 2.62
SERIE1 11:56 3.13
SERIE1 11:58 3.05

ARCHIVO 3

================================
CABECERA

CABECERA
================================
VALORES SERIE1 TRUST 12-10-2008 01:00:00 0.00
VALORES SERIE1 TRUST 12-10-2008 02:00:00 0.00
VALORES SERIE1 TRUST 12-10-2008 03:00:00 0.00
VALORES SERIE1 TRUST 12-10-2008 04:00:00 0.00
VALORES SERIE1 TRUST 12-10-2008 05:00:00 0.00
VALORES SERIE1 TRUST 12-10-2008 06:00:00 0.00
VALORES SERIE1 TRUST 12-10-2008 07:00:00 0.00
VALORES SERIE1 TRUST 12-10-2008 08:00:00 0.00
VALORES SERIE1 TRUST 12-10-2008 09:00:00 0.00
VALORES SERIE1 TRUST 12-10-2008 10:00:00 0.00
VALORES SERIE1 TRUST 12-10-2008 11:00:00 0.00
VALORES SERIE1 TRUST 12-10-2008 12:00:00 0.00
VALORES SERIE1 TRUST 12-10-2008 13:00:00 0.00
VALORES SERIE1 TRUST 12-10-2008 14:00:00 0.00
VALORES SERIE1 TRUST 12-10-2008 15:00:00 0.00
VALORES SERIE1 TRUST 12-10-2008 16:00:00 0.01
VALORES SERIE1 TRUST 12-10-2008 17:00:00 0.00
VALORES SERIE1 TRUST 12-10-2008 18:00:00 0.22
VALORES SERIE1 TRUST 12-10-2008 19:00:00 0.22
VALORES SERIE1 TRUST 12-10-2008 20:00:00 0.31
VALORES SERIE1 TRUST 12-10-2008 21:00:00 0.33
VALORES SERIE1 TRUST 12-10-2008 22:00:00 0.51
VALORES SERIE1 TRUST 12-10-2008 23:00:00 0.11
VALORES SERIE1 TRUST 13-10-2008 00:00:00 0.48
VALORES SERIE2 TRUST 12-10-2008 01:00:00 0.00
VALORES SERIE2 TRUST 12-10-2008 02:00:00 0.00
VALORES SERIE2 TRUST 12-10-2008 03:00:00 0.00
VALORES SERIE2 TRUST 12-10-2008 04:00:00 0.00
VALORES SERIE2 TRUST 12-10-2008 05:00:00 0.00
VALORES SERIE2 TRUST 12-10-2008 06:00:00 0.00
VALORES SERIE2 TRUST 12-10-2008 07:00:00 0.00
VALORES SERIE2 TRUST 12-10-2008 08:00:00 0.00
VALORES SERIE2 TRUST 12-10-2008 09:00:00 0.00
VALORES SERIE2 TRUST 12-10-2008 10:00:00 0.00
VALORES SERIE2 TRUST 12-10-2008 11:00:00 0.06
VALORES SERIE2 TRUST 12-10-2008 12:00:00 0.87
VALORES SERIE2 TRUST 12-10-2008 13:00:00 5.00
VALORES SERIE2 TRUST 12-10-2008 14:00:00 3.11
VALORES SERIE2 TRUST 12-10-2008 15:00:00 3.58
VALORES SERIE2 TRUST 12-10-2008 16:00:00 7.03
VALORES SERIE2 TRUST 12-10-2008 17:00:00 7.58
VALORES SERIE2 TRUST 12-10-2008 18:00:00 11.45
VALORES SERIE2 TRUST 12-10-2008 19:00:00 14.90
VALORES SERIE2 TRUST 12-10-2008 20:00:00 17.98
VALORES SERIE2 TRUST 12-10-2008 21:00:00 13.11
VALORES SERIE2 TRUST 12-10-2008 22:00:00 11.72
VALORES SERIE2 TRUST 12-10-2008 23:00:00 9.43
VALORES SERIE2 TRUST 13-10-2008 00:00:00 10.22

Por mingole

10 de clabLevel



 

firefox
Citar            
MensajeEscrito el 16 Oct 2008 01:05 am
Hola

Yo te recomiendo q uses PHP para parsear esos archivos y los conviertas en xml asi los podes cargar directamente muchos mas fasil al grafico

Saludos!

Por alfathenus

833 de clabLevel

5 tutoriales

 

buenos aires || Argentina

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.