Candles overlap in the candlestickchart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
wtw

Candles overlap in the candlestickchart

Post by wtw » Thu May 22, 2003 9:56 am

Hi All,

Is there anyway to make the candles in the candlestickchart not to overlap with each other? I have a lot of data within the chart and want them to fit together nicely. And the gaps between the data are really anonying, is there anyway to turn them off?

Thanks and regards,
Wtw

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 » Fri May 23, 2003 11:19 am

The javadocs for the setCandleWidth(...) method in the CandlestickRenderer class say:
Javadocs wrote:If you set the width to a negative value, the renderer will calculate the candle width automatically based on the space available on the chart.
Give it a try.
David Gilbert
JFreeChart Project Leader

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

erikvanoosten
Posts: 8
Joined: Tue Aug 30, 2005 10:42 am

Post by erikvanoosten » Tue Sep 13, 2005 11:43 am

The following will make a more suitable default for the auto-width-method:

Code: Select all

        candlestickRenderer.setAutoWidthMethod(CandlestickRenderer.WIDTHMETHOD_SMALLEST);

Jii
Posts: 128
Joined: Thu Apr 21, 2005 11:17 am

Post by Jii » Fri Sep 16, 2005 8:02 am

erikvanoosten wrote:The following will make a more suitable default for the auto-width-method:

Code: Select all

        candlestickRenderer.setAutoWidthMethod(CandlestickRenderer.WIDTHMETHOD_SMALLEST);

A word of warning: This is horribly horribly inefficient if there is anything above 1000 candles.

Locked