LineChartDemo1's graph does not display

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
mork
Posts: 10
Joined: Wed Dec 06, 2006 1:39 pm

LineChartDemo1's graph does not display

Post by mork » Mon Jan 08, 2007 3:31 pm

Hello,

I included the source code from the demo application for LineChartDemo1.java into Eclipse. I'm using 1.0.3 of JFreeChart.

When I run the example, I see the line chart as expected, but the background image is still just the gray background. If I step though the code, I see that it does find the 'png' file I added to the project from the demo source zip and the code does run imageURL != null code.

I have the following libraries in my Eclipse project:

-- jtext-1.4.6.jar
-- jcommon-1.0.8.jar
-- jcommon-1.0.8-junit.jar
-- jcommon.xml-1.0.8.jar
-- jfreechart-1.0.3.jar
-- junit.jar
-- OnBridge11small.png

(pardon any typos of these libraries' names... Version numbers are correct, however)

Any ideas why the background image is not displaying?

Thanks in advance for any replies or suggestions.

M

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Jan 10, 2007 5:49 pm

Do you have the .png file in the same directory as the LineChartDemo1.class file? That's where it looks, if I recall correctly.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

mork
Posts: 10
Joined: Wed Dec 06, 2006 1:39 pm

Post by mork » Wed Jan 10, 2007 5:55 pm

Yup, same directory.

It worked when I used a JPEG instead. Strange, eh?

Thanks very much for your reply.

------------

M

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Jan 10, 2007 6:05 pm

Maybe the .png file is corrupted? Can you load it in an image editor?
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked