Nov 20, 2013 Replies: 8 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: Code: AnchorPane.SetAnchors(SomeNode, 0, 0, 0, 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. Code: panePie.AddNode(cvs, 0, 0, panePie.PrefWidth, panePie.PrefHeight) 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+. Attachments Charts.zip Charts.zip 5.1 KB · Views: 2,142 Last edited: Nov 20, 2013 Click to expand...
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: Code: AnchorPane.SetAnchors(SomeNode, 0, 0, 0, 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. Code: panePie.AddNode(cvs, 0, 0, panePie.PrefWidth, panePie.PrefHeight) 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+.
P positrom2 Active Member Licensed User Longtime User Dec 2, 2013 #2 Where in the B4J code is the action defined that determines the plot types to be shown?
Erel B4X founder Staff member Licensed User Longtime User Dec 2, 2013 #3 See the code in the main module. It creates a different plot type for each of the panes.
P positrom2 Active Member Licensed User Longtime User Dec 2, 2013 #4 Are the different charts after having been created by the B4J code sent to the foreground just by JavaFx upon clicking on the respective tab? Is the click event seen in the B4J code? In Debug mode, nothing happens after Appstart has finished.
Are the different charts after having been created by the B4J code sent to the foreground just by JavaFx upon clicking on the respective tab? Is the click event seen in the B4J code? In Debug mode, nothing happens after Appstart has finished.
Erel B4X founder Staff member Licensed User Longtime User Dec 2, 2013 #5 You should see the bars chart when you run the program. Have you modified the code?
P positrom2 Active Member Licensed User Longtime User Dec 2, 2013 #6 I see the different chart screens -the program works as to be expected, I did not modify it. I just wanted to understand what happens when I click on a tab. In B4A, a click event would be handled by the code. Here, I don't see a Sub to handle an event.
I see the different chart screens -the program works as to be expected, I did not modify it. I just wanted to understand what happens when I click on a tab. In B4A, a click event would be handled by the code. Here, I don't see a Sub to handle an event.
Erel B4X founder Staff member Licensed User Longtime User Dec 2, 2013 #7 I now understand. TabPane was not yet wrapped in B4J. So you cannot handle its unique events. In this case the TabPane doesn't even have an id. In the designer I set the ids of the internal AnchorPanes (open the layout to see it). Nothing special happens when you click on the tab. It just switches to a different tab.
I now understand. TabPane was not yet wrapped in B4J. So you cannot handle its unique events. In this case the TabPane doesn't even have an id. In the designer I set the ids of the internal AnchorPanes (open the layout to see it). Nothing special happens when you click on the tab. It just switches to a different tab.
krlos2004 Member Licensed User Longtime User Jan 26, 2015 #9 for colored bars Chart : BD.Canvas.DrawRect(Rect, BD.BarsColors.Get(a), True, 1dip) 'not color for BD.Canvas.DrawRect(Rect, BD.BarsColors.Get(i-1), True, 1dip) ok
for colored bars Chart : BD.Canvas.DrawRect(Rect, BD.BarsColors.Get(a), True, 1dip) 'not color for BD.Canvas.DrawRect(Rect, BD.BarsColors.Get(i-1), True, 1dip) ok