I am plotting up to 16 traces, each one with 300 datapoints, I am updating continuously 100 datapoints every 100 ms. So on average I am updating in total 1600 datapoints every 100 ms and that is reaching the limit of points I can plot real time. Is there any way to improve even more the plotting speed or that amount of points is really reaching the limit of what can be achieved with JChart2D.
As a note, JChart2D is way better than other libraries as JFreeChart for real time applications. JFreeChart has a great functionality but is pretty heavy for real time.
The loop I am actually using whenever the swing worker is notified that data has been added is the following:
for (int l = 0; l < readcycles; l++){
sixteenBitNumber = data[l];
for (int k = 0; k < (SampledSignalPerPacket); k+=ScreenPointJump){
for (int o = 0; o < root.getChildCount(); o++){
for (int p = 0; p < graphnodes[o].getChildCount(); p++){
if (seriesindex[o][p] > ScreenSize){
seriesindex[o][p] = 0;
}
datapoint = (float)(sixteenBitNumber[signalnodes[o][p].signalIndex + NbOfSampledSignal*k])*10/32767;
trace[o][p].addPoint(seriesindex[o][p], datapoint);
seriesindex[o][p] = seriesindex[o][p] + ScreenPointJump;//seriesindex[o][p]++;
}
}
}
}
where trace has been initialized as
public Trace2DLtd[][] trace = new Trace2DLtd[4][4];