0

Using:

  • java 17
  • JavaFX 17
  • JFreeCharts 1.5.3
  • JFreeCharts FX 2.0.1

I would like to feed dynamic data to an OHLC plot with OHLCSeries I used the MaxItemCount but this is only good if all your time series has same dimensions

I need to show some trading signals that is not the same size as the OHLC series so the max item count will not work

Is there a way to show the latest 3 days (or the last 100 Hours) on a mixed series chart?

Using OHLCSeriesCollection for mixing OHLC and indicators (moving average) on the same chart. i.e. they don't happen on all the candle signals.

What if I need to add another TImeSeries (with a line&shape renderer) on the same chart but this one will have fewer items?

Can I use the Axis to control the items displayed by time?

    DateAxis dateAxis = new DateAxis("Time");

    CombinedDomainXYPlot mainPlot = new CombinedDomainXYPlot(dateAxis);

and adding data

    OHLCSeriesCollection candlestickDataset = new OHLCSeriesCollection();
    candlestickDataset.addSeries(new OHLCSeries());

    TimeSeriesCollection timeSeriesCollection = new TimeSeriesCollection();
    timeSeriesCollection.addSeries(new TImeSereis);

I noticed in old versions there was an option to add the TimeUint in the Series constructor. What is the alternative now?

ComparableObjectSeries doesnt have MaxItemAge?

EDIT:

Problem:

  • I have data with different occurrences over time
  • Data is TimeSeries & OHLCseries mix on the same chart (different renderers)
  • Data is dynamic and I would like to display only the last X points in time (3 days for example) i.e. aged are removed
Gadi
  • 1,539
  • 22
  • 37
  • In general, update the chart's model (dataset) and the listening view (plot) will update itself. As you've asked several questions, please focus on one and [edit] your question to include a [mre] that shows your approach. More [here](https://stackoverflow.com/search?tab=votes&q=%5bjfreechart%5d%20OHLCSeriesCollection) and [here](https://github.com/jfree/jfree-fxdemos). – trashgod Dec 23 '21 at 17:11
  • thank you, it is a single question, how to display dynamic data removing aged items when the data is different occurrences and types (time-series & OHLC)? I will edit the question – Gadi Dec 24 '21 at 10:26
  • Sorry, I'm not aware of a general solution. Two approaches for dynamic time series are examined [here](https://stackoverflow.com/q/5048852/230513). `SegmentedTimeline` is intended for discontinuous data; although deprecated, it is discussed [here](https://stackoverflow.com/search?tab=newest&q=SegmentedTimeline) – trashgod Dec 24 '21 at 12:45
  • Also consider `Pagination` to manage large datasets. – trashgod Dec 28 '21 at 17:24

0 Answers0