CandlestickRenderer

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
lia
Posts: 18
Joined: Sat Oct 14, 2006 5:02 am
Location: Victoria BC

CandlestickRenderer

Post by lia » Wed Apr 04, 2007 8:33 pm

Hi,
I need to set the outline paint for my candlestick chart. I am trying to use the commented out code in CandlestickChartDemo1 version 1.0.5. However I am getting a compile error at renderer.setUseOutlinePaint(true). (The api says that this method is available. )When I don't use it and go directly to renderer.setOutlinePaint(Color.gray) I don't get a gray outline, just the default green and red colors. Please help.

private static JFreeChart createChart(OHLCDataset dataset) {
JFreeChart chart = ChartFactory.createCandlestickChart(
"Candlestick Demo 1",
"Time",
"Value",
dataset,
true
);
XYPlot plot = (XYPlot) chart.getPlot();
NumberAxis axis = (NumberAxis) plot.getRangeAxis();
axis.setAutoRangeIncludesZero(false);
axis.setUpperMargin(0.0);
axis.setLowerMargin(0.0);
CandlestickRenderer renderer = (CandlestickRenderer) plot.getRenderer();
renderer.setUseOutlinePaint(true);
renderer.setOutlinePaint(Color.gray);
return chart;
}

lia
Posts: 18
Joined: Sat Oct 14, 2006 5:02 am
Location: Victoria BC

Post by lia » Thu Apr 05, 2007 3:04 am

I have found that I can set the outline paint by using setSeriesPaint(series#,Color).

Locked