Recent

Author Topic: best to use TAchart or role my own Tcanvas on android  (Read 4277 times)

mas steindorff

  • Sr. Member
  • ****
  • Posts: 428
best to use TAchart or role my own Tcanvas on android
« on: March 14, 2012, 07:51:38 pm »
would like to make some logging software that also graphs the data real-time.  I've use both TAchart and rolled my own chart using the tcanvas component on windows. 

1:Has or will the TAchart component been ported to android in the next 3 to 6 months?

2: are most of the Tcanvas options ported like the lineto and line color properties?

3: what pitfalls and troubles will I be asking for by using one component over the other?

thank you for you time.
windows 7/10 - laz 2.0 / 1.2.6 general releases

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: best to use TAchart or role my own Tcanvas on android
« Reply #1 on: March 15, 2012, 12:25:07 am »
Quote
Has or will the TAchart component been ported to android in the next 3 to 6 months?

TAChart is mostly widgetset-independent, so hopefully it either
already is usable on Android or will become usable as widgetset matures.

If I understand properly, current plan is to use CustomDrawn widgetset
for Android. If so, then TAChart is already partially working on that widgetset
at least on Windows.

Quote
are most of the Tcanvas options ported like the lineto and line color properties?

Note that this is the same question -- as soon as particular widgetset
will start supporting, say, colored lines, TAChart will be able to use them.

mas steindorff

  • Sr. Member
  • ****
  • Posts: 428
Re: best to use TAchart or role my own Tcanvas on android
« Reply #2 on: March 15, 2012, 12:48:21 am »
thanks ASK.

I seem to remember a post about TAchart changing it's base widget-set or something like that one or two years ago.  Do you recall that post and was the reason for that was to become more OS independent or where you becoming limited by the original widget-set or was it a coding issue?

If I do use TAchart and something it does is not yet supported, do you know if the widget-set is just nop() or I will need to go into TAchart and comment out the call?

At this point I'm just trying to get a feel for the level of commitment I need for this project and what things may be best reserved for a bounty and ballpark $ amounts.

windows 7/10 - laz 2.0 / 1.2.6 general releases

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: best to use TAchart or role my own Tcanvas on android
« Reply #3 on: March 15, 2012, 05:37:32 am »
TAChart has two levels of drawing abstraction.
First level is a drawing back-end. It allows to draw charts
on various media and/or file formats.
For example, you can generate charts as SVG files, print them,
draw them in OpenGL context etc.
http://wiki.lazarus.freepascal.org/TAChart_documentation#Drawers

Some back-ends, in turn, support several output formats themselves,
for example FPVectorial back-end can save chart in vector formats
such as DWG and CorelDraw.
The default drawing back-end is LCL canvas, which supports various
widgetsets. TAChart (almost) does not care about the specific
widgetset, it just uses TCanvas interface. So whatever is implemented
by TCanvas works in TAChart.

Based on the above you have two options for porting TAChart:
1) Add the missing features to CustomDraw widgetset
  (for example, from my brief testing it seems that it does not currently support
  line width > 1).
2) Use some other back-end, such as SVG or OpenGL.
3) Failing all the above, write Android-specifick back-end.

I am interested in porting TAChart to Android, but currently
lack time and equipment for testing on that platform.
However, if the first option will be feasible for you,
then my task will be much simpler -- I will just test
TAChart on CustomDrawn widgetset
and maybe help to implement what's missing there.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: best to use TAchart or role my own Tcanvas on android
« Reply #4 on: March 15, 2012, 04:49:50 pm »
Based on the above you have two options for porting TAChart:
1) Add the missing features to CustomDraw widgetset
  (for example, from my brief testing it seems that it does not currently support
  line width > 1).

If people start opening bug reports with some short test code I can fix any bugs in the CustomDrawn TCanvas.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: best to use TAchart or role my own Tcanvas on android
« Reply #5 on: March 15, 2012, 05:14:06 pm »
I just tested here and TPen.Width worked for me, see:

http://img843.imageshack.us/img843/6425/customdrawnpentest.png

mas steindorff

  • Sr. Member
  • ****
  • Posts: 428
Re: best to use TAchart or role my own Tcanvas on android
« Reply #6 on: March 20, 2012, 06:06:37 pm »
Thank you both for your input. 
It looks like "charting" should not be too big of a hurdle by the time I start this project.
windows 7/10 - laz 2.0 / 1.2.6 general releases