Public Sub Initialize(Callback As Object, EventName As String)
Prepare the instance before its other methods.
ELEVATEUI · B4A · XUI
Compare ranked categories when their labels are too long for vertical bars.
Charts & visualizations
Compare ranked categories when their labels are too long for vertical bars.
Animated conceptual demonstration, not an exact Android control screenshot.
In an analytics screen, choose this visualization when the user needs to compare the values represented by its axes or series.
Before integrating, examine its methods, events and Designer options.
Tutorials are based on existing project examples or audited APIs. Check each example’s prerequisites; B4A compilation is not claimed.
Review required libraries, Designer views and input data before compiling in B4A.
' Ejemplo autocontenido para la Activity principal de B4A.
' Habilitar las bibliotecas XUI y ElevateUI.
Sub Process_Globals
Private xui As XUI
End Sub
Sub Globals
Private Root As B4XView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Root = xui.CreatePanel("")
Activity.AddView(Root, 0, 0, 100%x, 100%y)
Root.Color = 0xFFF8FAFC
Dim chart As UIHorizontalBarChart
chart.Initialize(Me, "Progress")
chart.AddToParent(Root, 12dip, 20dip, 100%x - 24dip, 260dip)
chart.setTextTitle("Cumplimiento del objetivo")
chart.setAnimation(True, 850)
Dim ok As Boolean = chart.SetDataAsPercent( _
L(Array As Object("Equipo A","Equipo B","Equipo C")), _
L(Array As Object(70,95,50)), _
L(Array As Object(0xFF8B5CF6,0xFF06B6D4,0xFF10B981)), _
100, "$", "")
If ok = False Then Log("Datos porcentuales inválidos")
End Sub
' Convierte un array de Object en una lista B4A.
' Necesario para las firmas que aceptan List.
Private Sub L(Values() As Object) As List
Dim Result As List
Result.Initialize
Result.AddAll(Values)
Return Result
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause(UserClosed As Boolean)
End Sub
18 audited signatures
Public Sub Initialize(Callback As Object, EventName As String)
Prepare the instance before its other methods.
Public Sub AddToParent(Parent As B4XView, Left As Int, Top As Int, Width As Int, Height As Int)
Add this view to a parent container using the supplied bounds and options.
Public Sub DesignerCreateView(Base As Object, Lbl As Label, Props As Map)
Invoked automatically by the B4A Visual Designer; do not call manually.
Public Sub setTextTitle(Value As String)
Update text title at runtime when this setting changes.
Public Sub setShowGrid(Value As Boolean)
Update show grid at runtime when this setting changes.
Public Sub setShowAxes(Value As Boolean)
Update show axes at runtime when this setting changes.
Public Sub setShowYAxisValues(Value As Boolean)
Update show yaxis values at runtime when this setting changes.
Public Sub setShowXAxisValues(Value As Boolean)
Update show xaxis values at runtime when this setting changes.
Public Sub setShowValues(Value As Boolean)
Update show values at runtime when this setting changes.
Public Sub setAnimation(Enabled As Boolean, DurationMs As Int)
Update animation at runtime when this setting changes.
Public Sub SetTheme(TextColor As Int, GridColor As Int, BackgroundColor As Int)
Use SetTheme for its named operation; follow its exact signature.
Public Sub setSuffix(Value As String)
Update suffix at runtime when this setting changes.
Public Sub SaveAsPNG(Dir As String, FileName As String) As Boolean
Use SaveAsPNG for its named operation; follow its exact signature.
Returns: Boolean
Public Sub SetData(Labels As List, Values As List, Colors1 As List) As Boolean
Use SetData for its named operation; follow its exact signature.
Original catalog note: All lists must have equal length. Negative values extend left from zero.
Returns: Boolean
Public Sub SetDataAsPercent(Labels As List, Amounts As List, BarColors As List, PercentBase As Double, AmountPrefix As String, AmountSuffix As String) As Boolean
Use SetDataAsPercent for its named operation; follow its exact signature.
Original catalog note: Amounts stay numeric; prefix and suffix only control how tooltip values are displayed.
Returns: Boolean
Public Sub setRoundedBars(Value As Boolean)
Update rounded bars at runtime when this setting changes.
Public Sub setBarSpacing(Value As Float)
Update bar spacing at runtime when this setting changes.
Original catalog note: Vertical gap between rows. Pass a dip value such as 8dip.
Public Sub setMaximum(Value As Float)
Update maximum at runtime when this setting changes.
No custom Designer properties were found in the audited API.
No public callback events are declared in the catalog. You can still handle B4A events for controls inserted inside it.
Public mBase As B4XView