Menu

JChart2D performance

Help
Anonymous
2014-06-11
2014-06-26
  • Anonymous

    Anonymous - 2014-06-11

    I have been using JChart2D in An application for real time viewer. I have the following question:

    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. 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.

     
  • Achim Westermann

    Hi,

    perhaps the approach to use the Trace2DReplacing for your application would increase performance.

    Another one would consume at least twice as much memory. I am referring to your other post where you describe that you start painting 300 points and then want to start over again with x = 1 and replace those points:

    • Store each Point2D in an array within your application.
    • When you start over at x = 1 just take your points from the array and use method setLocation(x,y).
    • You then can use a Trace2DSimple.

    You can also try to use chart.setMinPaintLatency(100). The default is 50 which causes a higher probability of a triggered paint operation in the middle of your batch update of all points. You will get a screen update lower than 10 Hz.

    HTH,
    Achim

     
  • Camilo

    Camilo - 2014-06-18

    Hi,

    I am not sure if I am missing something but I am not able to implement your approach.

    Before I was using Trace2DLtd and I added points to the trace by
    trace.addPoint(seriesindex, datapoint);

    Now I am trying to use Trace2DReplacing, And I try o add points by
    TracePoint2D point;
    point = new TracePoint2D(seriesindex,datapoint);
    trace.addPointInternal(point);

    But with the latest the chart doesn't get updated.

    Looking into the API I saw that there is a Trace2DReplacing and a Trace2DLtdReplacing, what is exactly the difference between both of them, would Trace2DReplacing will have always a better performance?

    Thanks

    Camilo

     
  • Camilo

    Camilo - 2014-06-20

    Thanks Achim,

    Can you please post a short example code of how should it be used? Do I need to wait for a new release of the library to be able to implement it?

    Camilo

     
  • Achim Westermann

    Hi Camilo,

    you use it just like any other Trace. There is no difference. It has the different behaviour as described in the javadoc (http://jchart2d.sourceforge.net/docs/javadoc/info/monitorenter/gui/chart/traces/Trace2DReplacing.html).

    You can either wait for a new release (don't know when... but it is time regarding the amount fixes) or check out from git and build the jar for yourself.

    cheers,
    Achim

     
  • Camilo

    Camilo - 2014-06-26

    Hi Achim,

    I managed to download the code and compile it to try it out, but my code was not compiling. It seems that there are several packages missing, within them "views", "annotations", some "events" files, the PROPERTY_POINT_HIGHLIGHTERS_CHANGED variable in ITrace2D, etc...

    I will try to take only the files you modified and add them to the 3.2.2 build, I will compile it ant try it out. I will let you know the results.

    Best Regards

    Camilo

     
  • Anonymous

    Anonymous - 2014-06-26

    Hi Achim,

    It seems that ITrace2D has changed considerably from 3.2.2 to 3.3.0 because when I try to replace the modified files into the source code for 3.2.2. I get several compiling errors pointing to that file.

    Would it be possible to have a compilable version with the latest changes you performed in Trace2DReplacing.

    Thanks

    Camilo

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB