The attached project is a port of Basic4android charts framework: http://www.b4x.com/android/forum/threads/android-charts-framework.8260/#content
Note that this example uses a TabPane. TabPanes are currently not wrapped as a B4J type. However you can still use them with the help of the Scene Builder.
Another important point is the way we add the Canvases to each of the panes.
We want the canvas to fill the pane.
Usually the best way to do it is by setting all the anchors to 0:
However the automatic layout only works with resizeable nodes. Canvas and ImageView are not resizable. This means that we need to explicitly set the width and height.
We use PrefWidth and PrefHeight instead of Width and Height as the Width and Height of the tab panes are not available when the layout is created. They will only later be available.
This example requires v1.00 BETA 3+.


Note that this example uses a TabPane. TabPanes are currently not wrapped as a B4J type. However you can still use them with the help of the Scene Builder.
Another important point is the way we add the Canvases to each of the panes.
We want the canvas to fill the pane.
Usually the best way to do it is by setting all the anchors to 0:
B4X:
AnchorPane.SetAnchors(SomeNode, 0, 0, 0, 0)
B4X:
panePie.AddNode(cvs, 0, 0, panePie.PrefWidth, panePie.PrefHeight)
This example requires v1.00 BETA 3+.
Attachments
Last edited: