| |
Gráficos con Flash y Java fácil
 Imprimir la página |
¿Gráfico, Flash, Java?
Si necesitas crear gráficos que se miran bonito, Open Flash Chart es para ti. Open Flash Chart es un software libre, para crear gráficos muy profesionales, utilizando la tecnología Flash... sin necesidad de conocer Flash!
Open Flash Chart está diseñado principalmente para estar utilizado con el lenguaje PHP, y le hacía falta soporte para Java (exisitía un soporte basico).
Para esto SolucionJava.com ha desarollado una librería de etiquetas (Tag Library) con el objetivo de poder crear gráficos basados en datos saliendo de una base de datos.
Con esta librería, papa crear estos graficos conectados a una base de datos, basta con escribir la consulta SQL !
La librería esta liberada bajo licencia GPL, así que es gratis, tienes derecho de usarla a donde quieras, modifc¡icar el código, siempre cundo cumples con la licencia GPL.
Si tienes ganas de soportar este código, accepto todo tipo de apoyo: un laptop, dólares, un carro, un abrazo, un email... todo es lo bienvenido. Contactame para mas detalles.
Puedes descargar el código fuente usando los enlaces abajo (ver Download).
Mas informacion sobre la licencia GNU/GPL en http://www.gnu.org/licenses/gpl.html.
Una traduccion en español existe aqui: http://www.garaitia.com/new/gpl-spanish.php
Licencia : GPL
Autor : Cedric Simon - www.solucionjava.com
Codigo fuente: Download source Web Archive (war) file
Note : Database drivers are not included in source files !
Manual : Manual del curso de Graficos con Java
Sitio web principal de Open Flash Chart : http://teethgrinder.co.uk/open-flash-chart/
In english
Thanks to this JSP Tag library, creating flash chart from database retrieved data is really easy: just write the SQL
query as free text, and mention the custom attributes for the kind of chart you want to generate.
Check below sample to have an idea of what is possible to do using the library.
Licence : GPL
Author : Cedric Simon - www.solucionjava.com
Source code: Download source Web Archive (war) file
Note : Database drivers are not included in source files !
Open Flash Chart main site : http://teethgrinder.co.uk/open-flash-chart/
|
|
View JSP code / Ver código JSP
<ofc:OpenFlashChart
width="400"
height="200"
title="Simple Line chart example"
title_style="font-size:26px"
line_hollow_colour="#bdf"
line_hollow_dot_size="5"
line_hollow_text="Matagalpa"
line_hollow_font_size="12"
line_hollow_width="2"
>
select
tm.value_es,
total_ventas ,
date_format(fecha,'%m')
from
ventas tt
join months tm on (date_format(fecha,'%m')=tm.orden)
where tt.fecha between '2007-01-01' and '2007-06-30'
and no_site= 4
order by 3
</ofc:OpenFlashChart>
|
|
|
View JSP code / Ver código JSP
<ofc:OpenFlashChart
width="400"
height="200"
title="Area chart example"
title_style="font-size:26px"
area_hollow_colour="#C11B01"
area_hollow_dot_size="2"
area_hollow_fill_colour="#8E560F"
area_hollow_font_size="10"
area_hollow_text="Test"
area_hollow_width="3"
area_hollow_alpha="10"
>
select
tm.value_es,
total_ventas ,
date_format(fecha,'%m')
from
ventas tt
join months tm on (date_format(fecha,'%m')=tm.orden)
where tt.fecha between '2007-01-01' and '2007-06-30'
and no_site= 4
order by 3
</ofc:OpenFlashChart>
|
|
|
View JSP code / Ver código JSP
<ofc:OpenFlashChart
width="400"
height="200"
title="Multiple lines chart example"
title_style="font-size:26px"
numberOfDataSets="4"
set1Value="1"
set2Value="2"
set3Value="3"
set4Value="4"
line_hollow_colour="#3333ad"
line_hollow_dot_size="5"
line_hollow_text="Managua"
line_hollow_font_size="12"
line_hollow_width="2"
line_circles="15"
line_size="12"
line_width="2"
line2_colour="#af2566"
line2_text="Leon"
line_dot_dot_size="5"
line_dot_font_size="12"
line_dot_width="2"
line3_dot_colour="#777777"
line3_dot_text="Masaya"
line4_hollow_colour="#bdf"
line4_hollow_text="Matagalpa"
>
select
tm.value_es,
total_ventas ,
date_format(fecha,'%m'),
no_site
from ventas tt
join months tm on (date_format(fecha,'%m')=tm.orden)
where tt.fecha between '2007-01-01' and '2007-06-30'
order by 3 ,4
</ofc:OpenFlashChart>
|
|
|
View JSP code / Ver código JSP
<ofc:OpenFlashChart
width="400"
height="200"
title="Multiples bar chart example"
title_style="font-size:26px"
numberOfDataSets="3"
set1Value="1"
set2Value="2"
set3Value="3"
bar_alpha="50"
bar_sketch_colour="#3333ad"
bar_offset="10"
bar_text="Managua"
bar_size="12"
bar_sketch2_colour="#af2566"
bar2_text="Leon"
bar_sketch3_colour="#777777"
bar3_text="Masaya"
>
select
tm.value_es,
total_ventas ,
date_format(fecha,'%m'),
no_site
from
ventas tt
join months tm on (date_format(fecha,'%m')=tm.orden)
where tt.fecha between '2007-01-01' and '2007-06-30'
and no_site<=3
order by 3 ,4
</ofc:OpenFlashChart>
|
|
|
View JSP code / Ver código JSP
<ofc:OpenFlashChart
width="400"
height="200"
title="Mixed types chart example"
title_style="font-size:26px"
numberOfDataSets="4"
set1Value="1"
set2Value="2"
set3Value="3"
set4Value="4"
bar_alpha="50"
bar_filled_colour="#3333ad"
bar_offset="10"
bar_text="Managua"
bar_size="12"
bar_fade2_colour="#af2566"
bar2_text="Leon"
line_dot_dot_size="5"
line_dot_font_size="12"
line_dot_width="2"
line3_dot_colour="#777777"
line3_dot_text="Masaya"
line_hollow_colour="#bdf"
line_hollow_dot_size="5"
line_hollow_text="Matagalpa"
line_hollow_font_size="12"
line_hollow_width="2"
>
select
tm.value_es,
total_ventas ,
date_format(fecha,'%m'),
no_site
from
ventas tt
join months tm on (date_format(fecha,'%m')=tm.orden)
where tt.fecha between '2007-01-01' and '2007-06-30'
order by 3 ,4
</ofc:OpenFlashChart>
|
|
|
View JSP code / Ver código JSP
<ofc:OpenFlashChart
width="400"
height="200"
title="Pie chart example"
title_style="font-size:26px"
pie="SI"
pie_alpha="50"
pie_label_colour="{font-size:14px;}"
pie_line_colour="#0000ff"
pie_border_size="false"
pie_gradient="false"
>
select
case no_site when 1 then 'Managua' when 2 then 'Leon' when 3 then 'Masaya' when 4 then 'Matagalpa' end,
sum(total_ventas)
from
ventas tt
join months tm on (date_format(fecha,'%m')=tm.orden)
where tt.fecha between '2007-01-01' and '2007-06-30'
group by 1
</ofc:OpenFlashChart>
|
OpenFlashChart versión 2
Salió una nueva versi�n de OpenFlashChart (versi&oacuet;n 2), que no es compatible con la versión 1.
Existe una versión Alfa de la libreria de etiqueta JSP (codigo fuente en formato WAR) para la versión 2, que se puede descargar aquí.
Esta versión trae menos opciones que la versión estable, pero se sigue desarollando.
OpenFlashChart version 2
A new version of OpenFlashChart (version 2) is out, and is not compatible with version 1.
An Alfa release of the JSP Taglib (source code in WAR format) using OFC version 2 is availbale here.
This alfa release has less options implemented that the stable version. Developing is in process.
|