lcguida
lcguida

Reputation: 3847

Change Background Dashed Lines JFreeChart

I want to make my chart printible. I know JFreeChart already has a print configuration, but I need to make it printible (black & White) so I can save the image (already printable) in PNG and put that in a report.

I tried changing the background to white, but the dasehd lines in the background become invisible (they are already white).

I searched but I can't find an option to change it's color.

Can someone give me some light?

EDIT: Is a XY chart (originally whith a gray background an white dashed lines)

Upvotes: 1

Views: 2163

Answers (1)

matcauthon
matcauthon

Reputation: 2261

I have something like this in one of my sources:

plot.setBackgroundAlpha(0.25)
plot.setDomainMinorGridlinePaint(Color.GRAY)
plot.setDomainGridlinePaint(Color.DARK_GRAY)
plot.setRangeMinorGridlinePaint(Color.GRAY)
plot.setRangeGridlinePaint(Color.DARK_GRAY)

Maybe it helps.

It is also possible to apply a theme like:

StandardChartTheme.createJFreeTheme().apply(chart)

You could first apply any theme and then modify all the stuff you want.

Upvotes: 4

Related Questions