Ohlc chart in JFreeChart

I am currently working on a financial alert application and for the front end I decided to use JFreeChart. However, since I am new to this, there are some important things that I cannot imagine about ohlc plots:

- I would like to plot only a limited number of bars on the chart (say 300), and after that number reaches the oldest bars, to pop out of the chart.

- I noticed that if there are no bars for some time, then the domain is still being promoted. For example, if the start time is 12:00 and I have a bar for an hour, the first bar will be at 12: 00-13: 00, the next one will be at 13: 00-14: 00, but if the next update I receive , is at 17:38, then the next bar should be in the range of 17: 00-18: 00. I would like to know how to set the band 17: 00-18: 00 next to the band 13: 00-14: 00 without transition x within 4 hours in between.

- Can I write my own mouse events for this kind of chart?

Any suggestion or recommendation is greatly appreciated! Thanks x

0


a source to share


1 answer


You can try building your own implementation of org.jfree.chart.axis.SegmentedTimeline and then using the following from org.jfree.chart.ChartFactory :



ChartFactory.createHighLowChart(java.lang.String title,
                                java.lang.String timeAxisLabel,
                                java.lang.String valueAxisLabel,
                                OHLCDataset dataset,
                                Timeline timeline,
                                boolean legend)

      

+1


a source







All Articles