TeeChart for Java very slow on Android

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeChart for Java very slow on Android

Post by Yeray » Tue Jan 08, 2013 1:04 pm

Hello Gus,
gusg wrote:I can not post a complete app on a public forum, trade secrets and all that stuff. If you have a private way, that may be acceptable.
You can post your files at our upload page.
gusg wrote: Second, the data that adds the bar(s) is generated by hardware on the other processor in this design and sent to the Android display over a serial port. Without that other half to generate the data, it would be difficult to see it happen. Perhaps I could alter it to generate data locally by some other means, make me some suggestions here. Note that this app will only ever run on the one piece of hardware we are using. See info in the first post in this thread. Note that the demo seems to perform about the same way as our app does on this hardware.
Right, if you can generate some random data locally and reproduce the same problem with it, it would be very helpful.
Try with a for loop generating Random values.
The problem will be to generate an event to substitute your capturing system. You could try with a Timer or just some user interaction like a Button.
gusg wrote:More info. On further testing, I notice that series.add(v1, v2, Color.blue); executes very quickly. I have set chart.setAutoRepaint (false); before doing this and executed setMinMax before setting AutoRepaint to true again and then doing a chart.invalidate(); to get it to repaint. The big delay happens after this point. It appears to bog down the whole app to the point that nothing else seems to be keeping up while this is going on. I also notice that even after my app has painted the chart and is idle, scrolling by touch has similar delays. Drag the chart left or right with a finger and there is a long noticeable delay after dragging before it actually moves.
If the problem is that the application is too slow when you repaint the chart, it would indicate the problem resides in the number of points to draw (more points to draw means more time needed). So I'd suggest you to reduce the number of points by:
- Set FastLine's series DrawAllPoints property to false. This makes the series to only draw one point for all the points that coincide in a same X pixel, reducing the drawing time.
- DownSampling function to reduce the number of points to show.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

gusg
Newbie
Newbie
Posts: 11
Joined: Wed Nov 14, 2012 12:00 am

Re: TeeChart for Java very slow on Android

Post by gusg » Thu Jan 10, 2013 2:50 am

I have tried to upload a few times today, and no success. At first it would drop the connection in a few minutes, now I am getting an error back from your web server "[HttpException (0x80004005): Maximum request length exceeded.]". Will try again tomorrow. I have altered my app to insert data through the same chain of code as our serial interface via a button, and commented all the hardware specific stuff out for this test. This particular situation needs a bar chart, not a line, so fast line is out of the question. Testing with this setup has revealed another unrelated problem. The add fake data button I added puts data into two series. On the very first repaint after adding the first pairs of data to the two series, only one of them shows on the chart, the other does not until another pair of data are added. On every add after this point both show correctly. This flaw has most likely been there all the time, I just did not notice it until now with a button that deliberately adds both values at the same time. With data coming from my hardware, the probability of both happening at exactly the same time is low, however they will both occur within a few tens of milliseconds of each other. Watching what is happening with the debugger, the calls to series.add are happening for both series, however only the first encountered series displays on the very first set of data added. This flaw has probably made some of the slowness seem worse than it really is on the very first set of data displayed because one of the bars does not display when it should.

Gus

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeChart for Java very slow on Android

Post by Yeray » Thu Jan 10, 2013 9:57 am

Hi Gus,

We'd be pleased to take a look at this testing project. If you have problems uploading the sample you could try emailing it to us or pass us a download url and we'll download it from a server of yours. You can mail your files or your links at "info at steema dot com", referencing this thread.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeChart for Java very slow on Android

Post by Yeray » Tue Jan 15, 2013 1:24 pm

Hi Gus,

There was a problem reported some time ago for Swing (TJ71016295) that seems to be exactly the same than here: Having two Bar series in 2D, each one with just one value, the second Bar isn't drawn.
I've incremented the bug priority.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

gusg
Newbie
Newbie
Posts: 11
Joined: Wed Nov 14, 2012 12:00 am

Re: TeeChart for Java very slow on Android

Post by gusg » Mon Feb 04, 2013 3:41 pm

Just one more note on this subject, if I add series.getMarks ().setVisible( false); to the pair of series being displayed, they both display on the first set of data. This gets past the data missing on first insert, however it is still very slow in displaying the bars and very slow to scroll.

Gus

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeChart for Java very slow on Android

Post by Yeray » Tue Feb 05, 2013 1:05 pm

Hi Gus,

Thanks. This information could help us to find the root of the (TJ71016295) problem. I've added it to the item description.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply