JFreeChart Printing Problem sending huge data to printer

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
pkbhavani
Posts: 8
Joined: Fri Jul 13, 2007 4:01 pm

JFreeChart Printing Problem sending huge data to printer

Post by pkbhavani » Fri Jul 13, 2007 4:09 pm

when I add

plot.addRangeMarker(new ValueMarker(0.0));

or

NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
valueAxis.setAutoRangeIncludesZero(true);

when I print from the right click menu, it is sending huge bytes to the printer
you can reproduce this problem with TimeSeriesDemo12.java
add a point s2.add(new Minute(30, 9, 7, 12, 2003), -0.5); below 0.0 to see the effect.

[code] private static XYDataset createDataset() {

TimeSeriesCollection dataset = new TimeSeriesCollection();

TimeSeries s1 = new TimeSeries("Series 1", Minute.class);
s1.add(new Minute(0, 0, 7, 12, 2003), 1.2);
s1.add(new Minute(30, 12, 7, 12, 2003), 3.0);
s1.add(new Minute(15, 14, 7, 12, 2003), 8.0);

TimeSeries s2 = new TimeSeries("Series 2", Minute.class);
s2.add(new Minute(0, 3, 7, 12, 2003), 0.0);
s2.add(new Minute(30, 9, 7, 12, 2003), -0.5);
s2.add(new Minute(15, 10, 7, 12, 2003), 0.0);

dataset.addSeries(s1);
dataset.addSeries(s2);

return dataset;

}[/code]



[code]

plot.addRangeMarker(new ValueMarker(0.0));


[/code]

pkbhavani
Posts: 8
Joined: Fri Jul 13, 2007 4:01 pm

Post by pkbhavani » Fri Jul 13, 2007 7:27 pm

can someone reply, I am not able to send chart to printer. Its big problem with charts with lot of points.

pkbhavani
Posts: 8
Joined: Fri Jul 13, 2007 4:01 pm

any suggestions ?

Post by pkbhavani » Fri Jul 20, 2007 4:04 pm

any suggestions ?

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 » Fri Jul 20, 2007 5:29 pm

Does this problem *only* occur when you add in a negative value? Have you tried different JRE versions? What is your printer? Which operating system (and version) do you use? Have you modified anything else on the chart (any GradientPaint for example)?
David Gilbert
JFreeChart Project Leader

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

pkbhavani
Posts: 8
Joined: Fri Jul 13, 2007 4:01 pm

Post by pkbhavani » Fri Jul 27, 2007 3:45 pm

TimeSeriesDemo12.java : didn't modify anything else, just added one -ve value -0.5 to show up 0.0 value. This happens only when 0.0 is on x-axis, and x-axis 0.0 marker line appears.

Printer: Xerox Workcenter Pro 65
OS: Windows XP
JRE: latest jdk 1.6 update 2.

pkbhavani
Posts: 8
Joined: Fri Jul 13, 2007 4:01 pm

Post by pkbhavani » Mon Apr 14, 2008 8:24 pm

Still nobody have answer to this question ?

Taqua
JFreeReport Project Leader
Posts: 698
Joined: Fri Mar 14, 2003 3:34 pm
Contact:

Post by Taqua » Tue Apr 15, 2008 1:01 pm

This is caused by the Printing system of the JDK. Postscript (which is used as backend language) is not able to express Alpha-values on colors, so as soon as you start using transparency, the backend switches from Vector-Graphics into Raster-Image mode.

Another reason for large spool-files can be the use of non-printer fonts. In that case, the fonts get embedded as shapes, which increases the size of the spool-file as well.

However, in almost all cases I had to fix this class of problems in the reporting engine, it turned out that someone used transparent colors.

pkbhavani
Posts: 8
Joined: Fri Jul 13, 2007 4:01 pm

Post by pkbhavani » Tue Apr 15, 2008 3:05 pm

Thank you Taqua, as I mentioned in my observations above this happens only when there is 0.0 either on domain or range axis of JFree Chart. as a test case you can try with the above example.

Is there a fix planned to fix this problem ?

- Praveen

Locked