I generate a JFreeChart CandlestickChart , using OHLCSeries . And I extend CandlestickRenderer. In CandlestickRenderer, I overwrite "public Paint getItemPaint(int series, int item)" , in it I need the every stoke's date info to do something, but I don't know to get it , please help me to solve it.
Part of Codes as following:
OHLCSeries ohlcSeries = new OHLCSeries("Price");
for(Records record : recordslist ) {
double h =...;
....
LocalDate actionday = record.getRecordsDay ();
int year = actionday.getYear();
int month = actionday.getMonthValue();
int day = actionday.getDayOfMonth();
ohlcSeries.add(new Day(day,month,year), open, high, low, close);
}
OHLCSeriesCollection candlestickDataset.addSeries(ohlcSeries);
JFreeChart candlestickChart = ChartFactory.createCandlestickChart("", "","", candlestickDataset, true);
DateAxis dayAxis = new DateAxis ();
candlestickChart.getXYPlot().setDomainAxis(dayAxis);
class AnalysisCandlestickRenderer extends CandlestickRenderer {
public Paint getItemPaint(int series, int item) {
//here I need every stoke's date info , how can I get it?
}
}