Good morning. I am trying to recreate a LineChartModel and I can not get it to appear. The data is saved well in dateModel.addSeries (series). It also gives me no type of error.
If I try the primefaces page example it works fine, but compared to mine, I do not see differences in the obtaining of values.
I leave my code:
private void createDateModel() {
dateModel = new LineChartModel();
LineChartSeries series = new LineChartSeries();
series.setLabel("Series");
List<Coupon> cupon = cuponBean.cuponesPorDia();
List<Long> cuponCount = cuponBean.cuponesPorDiaCount();
for (int i = 0; i < cupon.size(); i++){
Date fecha = cupon.get(i).getPurchaseDatetime();
SimpleDateFormat sdf = new SimpleDateFormat("dd/M/yyyy");
String fechaFormateada = sdf.format(fecha);
int numeroCupones = Integer.parseInt(cuponCount.get(i).toString());
series.set(fechaFormateada,numeroCupones);
}
dateModel.addSeries(series);
dateModel.setTitle("Zoom for Details");
dateModel.setZoom(true);
dateModel.getAxis(AxisType.Y).setLabel("Values");
DateAxis axis = new DateAxis("Dates");
axis.setTickAngle(-50);
axis.setMax("2017-11-29");
axis.setTickFormat("%b %#d, %y");
dateModel.getAxes().put(AxisType.X, axis);
}