#Region Project Attributes
#ApplicationLabel: BarChart3D01
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: landscape
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim t As Timer
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private bc3d1 As BarChart3D01
Dim cnt As Int = 0
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main")
t.Initialize("t", 1000)
bc3d1.ChartDirection = bc3d1.CHART_DIRECTION_VERTICAL
bc3d1.ChartBackgroundColor = Colors.Black
bc3d1.ChartTitle = "SOME ARBITRARY DATA"
bc3d1.ChartTitleTextColor = Colors.Blue
bc3d1.ChartTitleTextSize = 20
bc3d1.ChartTitlePosition = bc3d1.Chart_Title_Position_Right
bc3d1.XaxisTitle = "Month - 2015"
bc3d1.XaxisTitleColor = Colors.Yellow
bc3d1.XaxisTitleTextSize = 20
bc3d1.Xaxis3DBaseColor = Colors.ARGB(150, 150, 200, 255)
bc3d1.XaxisLabelAngle = -30
bc3d1.XaxisLabelColor = Colors.Green
bc3d1.XaxisLabelTextSize = 20
bc3d1.ShowXaxisLabels = True
bc3d1.YaxisTitle = "Rainfall in mm"
bc3d1.YaxisTitleColor = Colors.Blue
bc3d1.YaxisTitleTextSize = 20
bc3d1.YaxisLabelAngle = -30
bc3d1.YaxisLabelColor = Colors.Magenta
bc3d1.YaxisLabelTextSize = 12
bc3d1.YaxisMin = 0
bc3d1.YaxisMax = 600
bc3d1.YaxisSteps = 100
bc3d1.BarAngle = -25
bc3d1.BarAlpha = 100
bc3d1.BarValuesVisible = True
bc3d1.BarValuesColor = Colors.White
bc3d1.BarValuesTextSize = 9
bc3d1.LegendBoxLineColor = Colors.Transparent
bc3d1.LegendLayout = bc3d1.LEGEND_LAYOUT_ROW
bc3d1.LegendHorizontalAlign = bc3d1.HORIZONTAL_ALIGN_LEFT
bc3d1.LegendBoxLineStyle = bc3d1.LINE_STYLE_DASH
bc3d1.LegendBoxLineWidth = 2.0
bc3d1.ShowLegendBox = True
bc3d1.LegendBoxBackgroundColor = Colors.Transparent
bc3d1.ShowLegendBoxBackground = True
bc3d1.ShowLegendBoxBorder = True
bc3d1.LegendTextSize = 11
bc3d1.LegendVerticalAlign = bc3d1.VERTICAL_ALIGN_TOP
bc3d1.ShowLegend = True
bc3d1.Bar1Data = Array As Double(210, 260, 410, 460, 160, 270)
bc3d1.Bar1Color = Colors.Cyan
bc3d1.Bar1LegendText = "Gauteng"
bc3d1.Bar2Data = Array As Double(160, 210, 260, 410, 460, 330)
bc3d1.Bar2Color = Colors.Blue
bc3d1.Bar2LegendText = "KwaZulu Natal"
bc3d1.Bar3Data = Array As Double(460, 160, 210, 260, 410, 510)
bc3d1.Bar3Color = Colors.Red
bc3d1.Bar3LegendText = "Orange Free State"
bc3d1.Bar4Data = Array As Double(410, 460, 160, 210, 260, 0)
bc3d1.Bar4Color = Colors.Green
bc3d1.Bar4LegendText = "Western Cape"
bc3d1.Bar5Data = Array As Double(260, 410, 460, 160, 210, 155)
bc3d1.Bar5Color = Colors.Yellow
bc3d1.Bar5LegendText = "Mpumalanga"
bc3d1.XaxisLabels = Array As String("Jan", "Feb", "Mar", "Apr", "May", "Jun")
bc3d1.PlotGridEvenRowBackgroundColor = Colors.ARGB(100, 200, 200, 200)
bc3d1.PlotGridOddRowBackgroundColor = Colors.ARGB(100, 175, 175, 175)
bc3d1.PlotGridHorizontalLineColor = Colors.Blue
bc3d1.PlotGridHorizontalLineStyle = bc3d1.LINE_STYLE_DOT
bc3d1.PlotGridHorizontalLineWidth = 0.5
bc3d1.PlotGridVerticalLineColor = Colors.Transparent
bc3d1.PlotGridVerticalLineStyle = bc3d1.LINE_STYLE_DASH
bc3d1.PlotGridVerticalLineWidth = 0.5
bc3d1.PlotPanMode = bc3d1.PLOT_PAN_MODE_HORIZONTAL
bc3d1.ToolTipTextColor = Colors.White
bc3d1.ToolTipBackgroundColor = Colors.DarkGray
bc3d1.ToolTipBorderColor = Colors.Black
bc3d1.chartRender
End Sub
Sub Activity_Resume
t.Enabled = True
End Sub
Sub Activity_Pause (UserClosed As Boolean)
t.Enabled = False
End Sub
Sub t_tick
cnt = cnt + 1
If cnt Mod 2 = 0 Then
bc3d1.XaxisLabels = Array As String("Jan", "Feb", "Mar", "Apr", "May", "Jun")
Else
bc3d1.XaxisLabels = Array As String("Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
End If
bc3d1.Bar1Data = Array As Double(Rnd(0,500), Rnd(0,500), Rnd(0,500), Rnd(0,500), Rnd(0,500), Rnd(0,500))
bc3d1.Bar2Data = Array As Double(Rnd(0,500), Rnd(0,500), Rnd(0,500), Rnd(0,500), Rnd(0,500), Rnd(0,500))
bc3d1.Bar3Data = Array As Double(Rnd(0,500), Rnd(0,500), Rnd(0,500), Rnd(0,500), Rnd(0,500), Rnd(0,500))
bc3d1.Bar4Data = Array As Double(Rnd(0,500), Rnd(0,500), Rnd(0,500), Rnd(0,500), Rnd(0,500), Rnd(0,500))
bc3d1.Bar5Data = Array As Double(Rnd(0,500), Rnd(0,500), Rnd(0,500), Rnd(0,500), Rnd(0,500), Rnd(0,500))
bc3d1.chartRender
End Sub