How can I make a GIF image of these graphs?
Thanks in Advance,
Paul
Making GIF of the Graphs
RE: Making GIF of the Graphs
Paul,
Follow this link to a brief description of how to create a PNG format image with JFreeChart using an open-source PNG encoder:
http://sourceforge.net/docman/display_d ... p_id=15494
You could do something similar if you have a GIF encoder but, to be honest, PNG is a superior format.
Regards,
DG.
Follow this link to a brief description of how to create a PNG format image with JFreeChart using an open-source PNG encoder:
http://sourceforge.net/docman/display_d ... p_id=15494
You could do something similar if you have a GIF encoder but, to be honest, PNG is a superior format.
Regards,
DG.
RE: Making GIF of the Graphs
I think most of them do now. Netscape and IE added support for PNG around version 3 or 4. I use Konqueror which certainly does.
If you can see the demo charts on the JFreeChart web-page, then your own browser supports PNG.
DG
If you can see the demo charts on the JFreeChart web-page, then your own browser supports PNG.
DG
RE: Making GIF of the Graphs
Paul, I have used the PNG encoder given by David Gilbert, and inorder to produce a gif file what i have done was when saving the graph to a file instance i have given the filename ending with .gif, or .jpg and it saved it as a gif and jpg without any problem. I then used a scroll pane to load the image. Hope this helps.
Regards,
Navin.
Regards,
Navin.
RE: Making GIF of the Graphs
Take a look at this code:
File fileHorizontalBarChart = new File("C:/HBChart");
saveChartAsPNG(chart, fileHorizontalBarChart, 600,600);
Take a look at this one and note the File name is HBChart.gif
File fileHorizontalBarChart = new File("C:/HBChart.gif");
saveChartAsPNG(chart, fileHorizontalBarChart, 600,600);
After compiling and running it will save it as a gif file without any problem.
This is what i mean.
Hope this helps.
Regards,
Navin.
File fileHorizontalBarChart = new File("C:/HBChart");
saveChartAsPNG(chart, fileHorizontalBarChart, 600,600);
Take a look at this one and note the File name is HBChart.gif
File fileHorizontalBarChart = new File("C:/HBChart.gif");
saveChartAsPNG(chart, fileHorizontalBarChart, 600,600);
After compiling and running it will save it as a gif file without any problem.
This is what i mean.
Hope this helps.
Regards,
Navin.
RE: Making GIF of the Graphs
Hi
Well that shouldnt be to difficult:
First of all you need software that allos you to produce gifs, take java resources: I recommend producing png "images": theres no license like on compuserve gifs on that. After all you should have a method like gifencode() or pngencode() which takes a java.awt.Image and then produces an gif of your chart.
You can get this Image by adding your chart to an instance of JFreeChartPanel.
Then you produce a Graphics Object by calling createGraphics() on JFreeChartPanel wich extends java Component. Then call paint("Graphics Object"): At leat you can get your Image with a method like produceImage() or getImage() called on your Graphics: encode Your Image .......... Ready.
Well that shouldnt be to difficult:
First of all you need software that allos you to produce gifs, take java resources: I recommend producing png "images": theres no license like on compuserve gifs on that. After all you should have a method like gifencode() or pngencode() which takes a java.awt.Image and then produces an gif of your chart.
You can get this Image by adding your chart to an instance of JFreeChartPanel.
Then you produce a Graphics Object by calling createGraphics() on JFreeChartPanel wich extends java Component. Then call paint("Graphics Object"): At leat you can get your Image with a method like produceImage() or getImage() called on your Graphics: encode Your Image .......... Ready.