Hi,
My problem is that I can’t set category axis as I want.
my code :
int row = 4;
int chartIndex = chartsVibration.add(ChartType.SCATTER, row, 1, row+18, 20);
Chart chart1 = chartsVibration.get(chartIndex);
for(int i = 0; i<labels.size(); i++)
{
cellsPageVibration.get(row, 23+i).setValue(labels.get(i));
cellsPageVibration.get(row+1, 23+i).setValue(valeursX.get(i));
cellsPageVibration.get(row+2, 23+i).setValue(valeursY.get(i));
cellsPageVibration.get(row+3, 23+i).setValue(valeursZ.get(i));
}
String nomPremierCellLabels = cellsPageVibration.get(row, 23).getName();
String nomDernierCellLabels = cellsPageVibration.get(row, 23+labels.size()-1).getName();
String nomPremierCellValeurs = cellsPageVibration.get(row+1, 23).getName();
String nomDernierCellValeurs = cellsPageVibration.get(row+3, 23+labels.size()-1).getName();
SeriesCollection nSeries = chart1.getNSeries();
nSeries.setCategoryData(nomPremierCellLabels+":"+nomDernierCellLabels);
nSeries.add(nomPremierCellValeurs+":"+nomDernierCellValeurs, false);
nSeries.setColorVaried(true);
Axis valueAxis = chart1.getValueAxis();
valueAxis.getTitle().setText(“mm/sec”);
valueAxis.setMinValue(0);
valueAxis.getTitle().setTextVerticalAlignment(TextAlignmentType.JUSTIFY);
valueAxis.setVisible(true);
Axis categoryAxis = chart1.getCategoryAxis();
categoryAxis.getTitle().setText(“Heure”);
Series series1 = nSeries.get(0);
series1.setValues(nomPremierCellValeurs+":"+cellsPageVibration.get(row+1, labels.size()-1).getName());
series1.setName(“Vitesse vibratiore X”);
Series series2 = nSeries.get(1);
series2.setValues(cellsPageVibration.get(row+2, 23).getName()+":"+cellsPageVibration.get(row+2, labels.size()-1).getName());
series2.setName(“Vitesse vibratiore Y”);
Series series3 = nSeries.get(2);
series3.setValues(cellsPageVibration.get(row+3, 23).getName()+":"+nomDernierCellValeurs);
series3.setName(“Vitesse vibratiore Z”);
As category axis labels I want to see: 00:00, 01:00, 02:00 etc. up to 23:59,
and here I got : 0, 500, 1000, up to 3500
What do I wrong? Please, help
2018-10-08_10h55_12.png (53.1 KB)