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

JFreeChart y netbeans

Estas en el tema de JFreeChart y netbeans en el foro de Java en Foros del Web. hola quiero hacer una aplicacion para la facultad y necesito hacer unos graficos, estuve viendo y veo que el JFreeChart es lo que necesito, hay ...
  #1 (permalink)  
Antiguo 16/04/2008, 22:01
Avatar de johnnygomez  
Fecha de Ingreso: octubre-2007
Mensajes: 166
Antigüedad: 16 años, 6 meses
Puntos: 0
JFreeChart y netbeans

hola quiero hacer una aplicacion para la facultad y necesito hacer unos graficos, estuve viendo y veo que el JFreeChart es lo que necesito, hay un ejemplo que me viene bien, pero cuando quiero probar para usarlo, me tira error al importar los archivos. El ejemplo puntual es

Código PHP:
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;
import java.io.File;
import java.io.*;
import org.jfree.data.time.Day;
import org.jfree.data.time.*;
public class 
TimeSeries {
public static 
void main(String[] args) {
// Create a time series chart
org.jfree.data.time.TimeSeries pop = new org.jfree.data.time.TimeSeries(”Linea de Crecimiento”Day.class);
pop.add(new Day(212007), 100);
pop.add(new Day(222007), 150);
pop.add(new Day(232007), 200);
pop.add(new Day(242007), 250);
pop.add(new Day(252007), 300);
pop.add(new Day(262007), 1500);
TimeSeriesCollection dataset = new TimeSeriesCollection();
dataset.addSeries(pop);
JFreeChart chart ChartFactory.createTimeSeriesChart(
“Crecimiento Ubuntu”,
“Fecha”,
“Numero Usuarios”,
dataset,
true,
true,
false);
try {
ChartUtilities.saveChartAsJPEG(new File(/home/jose/Desktop/TimeSeries.jpg”), chart500300);
} catch (
IOException e) {
System.err.println(”Error creando grafico.);
}
}} 
i

inclui los 2 jar jcommon-1.0.12.jar y jfreechart-1.0.9-demo.jar pero los "import" me tiran error todos menos import java.io.File;
import java.io.*;
que estoy haciendo mal?
  #2 (permalink)  
Antiguo 11/10/2009, 18:22
Avatar de rocksoul16  
Fecha de Ingreso: agosto-2009
Ubicación: Colombia
Mensajes: 9
Antigüedad: 14 años, 9 meses
Puntos: 0
Respuesta: JFreeChart y netbeans

Cómo importaste las librerías?, Además de agregarlas en Library Manager también debes agregarlas a tu proyecto, al lado izquierdo en tu carpeta de Libraries, haz click derecho, le das Add Library y luego seleccionas dichas librerías.

Espero haberte ayudado en algo...
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 20:17.