我正在尝试实现XYPointerAnnotation
图表TimeSeries
。但是我不知道,图表如何找到我要绘制的 y 值。代码:
final TimeSeries series = new TimeSeries("asdfas");
Hour hour = new Hour();
series.add(2,hour), 123);
TimeSeriesCollection collection = new TimeSeriesCollection();
collection.addSeries(series);
double temp = Double.parseDouble(
series1.getTimePeriod(series1.getItemCount()-1).toString());
XYPointerAnnotation pointer1 = new XYPointerAnnotation(
series1.getValue(series1.getItemCount() - 1).toString(), temp, 00.0);
JFreeChart chart = ChartFactory.createTimeSeriesChart(
"1", "2", "3", collection, true, true, false);
如何将 y 值从 解析TimeSeries
到XYPointerAnnotation
?