I have the following problem when using any JavaFX chart: I dynamically add data to the chart and only the last X-Axis label appears.
I already noticed that the chart displays fine when the animation is turned off.
XYChart.Series<String,Double> series1= new Series<String, Double>(); series1.setName(scenario1.getName()); XYChart.Series<String,Double> series2= new Series<String, Double>(); series2.setName(scenario2.getName()); for(int period = 0; period < config1.getPeriods(); period++){ series1.getData().add(new Data<String, Double>("Period "+(period+1), rmList1.get(0).getCashflowsPerPeriod(config1)[period])); System.out.println("Series1: "+rmList1.get(0).getCashflowsPerPeriod(config1)[period]); } for(int period = 0; period < config2.getPeriods(); period++){ series2.getData().add(new Data<String, Double>("Period "+(period+1), rmList2.get(0).getCashflowsPerPeriod(config2)[period])); System.out.println("Series2: "+rmList2.get(0).getCashflowsPerPeriod(config2)[period]); } sacCashflows.getData().addAll(series1,series2);
Could you help me? Thanks!
source share