dots and stripes textures

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
iamaway
Posts: 2
Joined: Mon Jun 19, 2006 5:50 pm

dots and stripes textures

Post by iamaway » Mon Jun 19, 2006 6:01 pm

Hello,
I am pretty new in the forum and my english is probably not very good...
But i'll try to explain my problem
we use the jfreechart at schools in germany, and we have the problem, that the teachers like more the printed versions of our calculation-charts, unfortunately on black-white printers :( ...
Is it possible to give the charts instead of colors structures like the color red: gets dots, yellow: orthographic lines, green: level lines, blue: diagonal lines and so on?
That would help to interpretate the charts more effective in the "offline-modus"

Thanks for help
and greetings from germany,
Sebastian

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

Post by Taqua » Mon Jun 19, 2006 7:04 pm

Hi,

I'm quite sure that 'TexturePaints' will resolve your problem. Each Color is an instance of Paint and JFreeChart does not reference colors as such - it always references Paints. So create your TexturePaint instances with a suitable bitmap (BufferedImage with Monochrome colorrange) and replace the paints in your chart with your texture paints.

Regards,
Thomas

iamaway
Posts: 2
Joined: Mon Jun 19, 2006 5:50 pm

TexturePaints

Post by iamaway » Mon Jun 19, 2006 7:14 pm

Thanx Thomas,
i have two more questions,
Do you know how to do that and Where to change the TexturePaints with the jfreechartPaints?
I just read something in the Forum, how to change the color over names
(instead red blue...)

Thanks Sebastian

Ivoryn
Posts: 8
Joined: Tue Apr 04, 2006 2:01 pm

Post by Ivoryn » Tue Jun 20, 2006 9:19 am

hi, does anybody have an example of how to use the TexturePaints?

I would really appreciate if anybody could post some code. I really need this feature.

Thank you.

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

Post by Taqua » Tue Jun 20, 2006 10:24 am

Hi,

JFreeChart does not accept string-names for colors - it always expects java.awt.Paint instances. So whatever you've read - they probably used Color.RED or Color.GREEN (which is a "public static Color" constant, as your IDE will tell you). Replace it with a reference to your TexturePaint instance and you should be fine.

For using TexturePaints: http://www.google.com/search?q=TextureP ... 8&oe=utf-8

Regards,
Thomas

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 Jun 21, 2006 11:08 am

You can use TexturePaint with JFreeChart, but because the textures are just bitmaps, the quality of printed output won't be so good.
David Gilbert
JFreeChart Project Leader

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

liaoya
Posts: 9
Joined: Mon May 21, 2007 5:13 am

Post by liaoya » Wed Mar 19, 2008 8:43 am

Create a TexturePaint is not very easy. Maybe JFreeChart can consider to provide several default TexturePaint for fill as Matlab and gnuplot do.

See http://gnuplot.sourceforge.net/demo/fillstyle.html for a exmaple. I think most teacher will like these style chart.

Locked