This is the next question from this question .
The following happens:
When I start the chart, and I drag the chart around, something strange happens: after a certain period of time every 7 periods, the candlesticks become smaller and smaller, until they are just a strip. Then, as I stretch further, they become thicker again until they become normal. It seems to happen every 7 periods.
An example of this phenomenon is displayed in the following 3 pictures:



The following code will show exactly what I mean. Just compile and run it. Then press and hold CTRL and click and hold on the chart. Now try dragging the chart to the right or left. After some βdrag and dropβ you will notice an error.
My question is: how to prevent / trick this?
the code:
import org.jfree.chart.*; import org.jfree.chart.axis.*; import org.jfree.chart.plot.XYPlot; import org.jfree.chart.renderer.xy.CandlestickRenderer; import org.jfree.data.xy.*; import javax.swing.*; import java.awt.*; import java.io.*; import java.net.URL; import java.text.*; import java.util.*; import java.util.List; public class CandlestickDemo2 extends JFrame { public CandlestickDemo2(String stockSymbol) { super("CandlestickDemo"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); DateAxis domainAxis = new DateAxis("Date"); NumberAxis rangeAxis = new NumberAxis("Price"); CandlestickRenderer renderer = new CandlestickRenderer(); XYDataset dataset = getDataSet(stockSymbol); XYPlot mainPlot = new XYPlot(dataset, domainAxis, rangeAxis, renderer);
Update
This error is now a registered error on the sourceforge JFreeChart page.
This error can be tracked here .
source share