How to set paint color of standard zoom rectangle line

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
dlucas
Posts: 19
Joined: Sat Dec 29, 2007 5:07 am
Location: Boston (USA)

How to set paint color of standard zoom rectangle line

Post by dlucas » Mon Feb 25, 2008 6:51 am

Hi Dave -

I have checked the developer documentation and searched through the available setter methods, but I haven't found a way to control the paint color of the zoom rectangle lines. The problem that I am having is that I am using a black XYPlot background and the zoom rectangle lines are also black so don't show up. If I use a white chart background, the lines are black and visible.

For the record, I am using 1.0.8a, SWT ChartComposite, and used the following code to set the color of the background:

JFreeChart chart = ChartFactory.createXYLineChart(title, scopeXLabel, scopeYLabel, seriesCollection[0], PlotOrientation.VERTICAL, false, true, false);
chart.setBackgroundPaint(Color.white);
chart.setBorderVisible(true);
chart.setBorderPaint(Color.darkGray);
chart.setAntiAlias(true);
XYPlot scopeXYPlot = chart.getXYPlot();
scopeXYPlot.setBackgroundPaint(Color.black);


I don't know if it matters, but I am using the XYLineAndShape renderer and an XYSeriesCollection[] to hold the data.
Best regards,

Don

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 » Thu Feb 28, 2008 5:07 am

I'm guessing a bit with the ChartComposite code, but looking through it I can't see anywhere that the rectangle colour is being set. That's probably a bug, but I'd have to study the code some more...
David Gilbert
JFreeChart Project Leader

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

Locked