problem with candlestick color
Posted: Tue Feb 21, 2006 5:41 pm
Hi all,
I am a student and a newbie in using JFreeChart (v.1.0.1). I am currently doing a project related to stock, and while I am building a candlestick chart with JFreeChart class, I met a problem where my code: setUpPaint(new Color(0xFFFFFF)) works, but setDownPaint(new Color(0x000000)) failed, so results in my chart displayed with all candlestick filled with only white color (or if i didn't set the up and down paint, by default all candlesticks are filled with green, instead of green/red where it suppose to).
here's the portion of my code:

I am a student and a newbie in using JFreeChart (v.1.0.1). I am currently doing a project related to stock, and while I am building a candlestick chart with JFreeChart class, I met a problem where my code: setUpPaint(new Color(0xFFFFFF)) works, but setDownPaint(new Color(0x000000)) failed, so results in my chart displayed with all candlestick filled with only white color (or if i didn't set the up and down paint, by default all candlesticks are filled with green, instead of green/red where it suppose to).
here's the portion of my code:
Anyone have idea why the problem exists? I have saw many posts in forum, and seems no one have this problem except me. Thanks for your time!CandlestickRenderer renderer = new CandlestickRenderer();
renderer.setDrawVolume(false);
renderer.setAutoWidthMethod(renderer.WIDTHMETHOD_AVERAGE);
renderer.setDownPaint(new Color(0x000000));
enderer.setUpPaint(new Color(0xFFFFFF));
chart.getXYPlot().setRenderer(renderer);
chart.setBackgroundPaint(Color.white);
