Please help i have this layout in my project but i would only want only this layout to be loaded in landscape mode please find attached that small project thanks in advance
B4X:
#Region Project Attributes
#ApplicationLabel: BarChart
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Private xui As XUI
Private BarChart, LineChart As xChart
Private Yrs As String
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
FillCharts
'FillCharts1
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
'my vision on how to display the data
Private Sub FillCharts
Private lstIDs, lstMarksEng, lstMarksScience, lstMarksSst, lstMarksMaths, lstNames, lstYears, lstSemesters, lstSubjects As List
Private ResultSet1 As ResultSet
Private Query As String
Private StudentName As String
lstIDs.Initialize
lstMarksEng.Initialize
lstMarksScience.Initialize
lstMarksSst.Initialize
lstMarksMaths.Initialize
lstNames.Initialize
lstYears.Initialize
lstSemesters.Initialize
lstSubjects.Initialize
lstSubjects.Add("Eng")
lstSubjects.Add("Science")
lstSubjects.Add("Sst")
lstSubjects.Add("Maths")
'Name = "MAKUMBI TARIQ AZIZI"
'Query = "SELECT Names, Total, Subject FROM Academics WHERE Names = ?"
' Query = "SELECT ID, Names, Eng, Science, Sst, Maths, Years from students"¨
StudentName = "Sulaiman"
Query = "SELECT ID, Years, Semester, Eng, Science, sst, Maths FROM students WHERE Names = '" & StudentName & "'"
'ResultSet1 = Starter.SQL1.ExecQuery2(Query, Array As String(Name))
ResultSet1 = Starter.SQL1.ExecQuery(Query)
Do While ResultSet1.NextRow
lstIDs.Add(ResultSet1.GetLong("ID"))
' lstNames.Add(ResultSet1.GetString("Names"))
lstYears.Add(ResultSet1.GetInt("Years"))
lstSemesters.Add(ResultSet1.Getstring("Semester"))
'lstSemesters.Add(ResultSet1.GetInt("Semester"))
lstMarksEng.Add(ResultSet1.GetInt("Eng"))
lstMarksScience.Add(ResultSet1.GetInt("Science"))
lstMarksSst.Add(ResultSet1.GetInt("Sst"))
lstMarksMaths.Add(ResultSet1.GetInt("Maths"))
Loop
'Bar chart
BarChart.ClearData
BarChart.AddBar("Eng", xui.Color_Red)
BarChart.AddBar("Science", xui.Color_Blue)
BarChart.AddBar("Sst", xui.Color_Green)
BarChart.AddBar("Maths", xui.Color_Yellow)
For i = 0 To lstIDs.Size - 1
'BarChart.AddBarMultiplePoint(lstYears.Get(i) & " - " & lstSemesters.Get(i), Array As Double(lstMarksEng.Get(i), lstMarksScience.Get(i), lstMarksSst.Get(i), lstMarksMaths.Get(i)))
BarChart.AddBarMultiplePoint(lstSemesters.Get(i), Array As Double(lstMarksEng.Get(i), lstMarksScience.Get(i), lstMarksSst.Get(i), lstMarksMaths.Get(i)))
Yrs=lstYears.Get(i)
Next
BarChart.YAxisName = "marks"&"-"&Yrs
BarChart.Title = StudentName
' BarChart.XAxisName = "total marks = " & Total
BarChart.DrawChart
'Line chart
LineChart.ClearData
LineChart.AddLine2("Eng", xui.Color_Red, 2dip, "CIRCLE", False, xui.Color_Red)
LineChart.AddLine2("Science", xui.Color_Blue, 2dip, "CIRCLE", False, xui.Color_Blue)
LineChart.AddLine2("Sst", xui.Color_Green, 2dip, "CIRCLE", False, xui.Color_Green)
LineChart.AddLine2("Maths", xui.Color_Yellow, 2dip, "CIRCLE", False, xui.Color_Yellow)
For i = 0 To lstIDs.Size - 1
'LineChart.AddLineMultiplePoints(lstYears.Get(i) & " - " & lstSemesters.Get(i), Array As Double(lstMarksEng.Get(i), lstMarksScience.Get(i), lstMarksSst.Get(i), lstMarksMaths.Get(i)), True)
LineChart.AddLineMultiplePoints(lstSemesters.Get(i), Array As Double(lstMarksEng.Get(i), lstMarksScience.Get(i), lstMarksSst.Get(i), lstMarksMaths.Get(i)), True)
Yrs=lstYears.Get(i)
Next
LineChart.YAxisName = "marks"&"-"&Yrs
LineChart.Title = StudentName
LineChart.DrawChart
End Sub
'your vision on how to display the data
Private Sub FillCharts1
Private i , j As Int
'Private Name As String
Private lstIDs, lstMarksEng, lstMarksScience, lstMarksSst, lstMarksMaths, lstNames, lstYears, lstSemesters, lstSubjects As List
Private ResultSet1 As ResultSet
Private Query As String
Private StudentName As String
lstIDs.Initialize
lstMarksEng.Initialize
lstMarksScience.Initialize
lstMarksSst.Initialize
lstMarksMaths.Initialize
lstNames.Initialize
lstYears.Initialize
lstSemesters.Initialize
lstSubjects.Initialize
lstSubjects.Add("Eng")
lstSubjects.Add("Science")
lstSubjects.Add("Sst")
lstSubjects.Add("Maths")
'Name = "MAKUMBI TARIQ AZIZI"
'Query = "SELECT Names, Total, Subject FROM Academics WHERE Names = ?"
' Query = "SELECT ID, Names, Eng, Science, Sst, Maths, Years from students"¨
StudentName = "Sulaiman"
Query = "SELECT ID, Years, Semester, Eng, Science, sst, Maths FROM students WHERE Names = '" & StudentName & "'"
'ResultSet1 = Starter.SQL1.ExecQuery2(Query, Array As String(Name))
ResultSet1 = Starter.SQL1.ExecQuery(Query)
Do While ResultSet1.NextRow
lstIDs.Add(ResultSet1.GetInt("ID"))
' lstNames.Add(ResultSet1.GetString("Names"))
lstYears.Add(ResultSet1.GetString("Years"))
lstSemesters.Add(ResultSet1.GetString("Semester"))
lstMarksEng.Add(ResultSet1.GetString("Eng"))
lstMarksScience.Add(ResultSet1.GetString("Science"))
lstMarksSst.Add(ResultSet1.GetString("Sst"))
lstMarksMaths.Add(ResultSet1.GetString("Maths"))
Loop
'Bar chart
BarChart.ClearData
For i = 0 To lstYears.Size - 1
' BarChart.AddBar(lstYears.Get(i) & " " & lstSemesters.Get(i), xui.Color_RGB(Rnd(0, 256), Rnd(0, 256), Rnd(0, 256)))
BarChart.AddBar( lstSemesters.Get(i), xui.Color_RGB(Rnd(0, 256), Rnd(0, 256), Rnd(0, 256)))
Yrs=lstYears.Get(i)
Next
For i = 0 To lstSubjects.Size - 1
Private Vals(lstIDs.Size) As Double
Select lstSubjects.Get(i)
Case "Eng"
For j = 0 To lstIDs.Size - 1
Vals(j) = lstMarksEng.Get(j)
Next
Case "Science"
For j = 0 To lstIDs.Size - 1
Vals(j) = lstMarksScience.Get(j)
Next
Case "Sst"
For j = 0 To lstIDs.Size - 1
Vals(j) = lstMarksSst.Get(j)
Next
Case "Maths"
For j = 0 To lstIDs.Size - 1
Vals(j) = lstMarksMaths.Get(j)
Next
End Select
BarChart.AddBarMultiplePoint(lstSubjects.Get(i), Vals)
Next
BarChart.YAxisName = "marks"&"-"&Yrs
BarChart.Title = StudentName
' BarChart.XAxisName = "total marks = " & Total
BarChart.DrawChart
'Line chart
' LineChart.ClearData
' LineChart.AddLine("marks", xui.Color_Blue)
' LineChart.AddLine2("marks", xui.Color_Blue, 2dip, "SQUARE", False, xui.Color_Blue)
' For i = 0 To lstSubject.Size - 1
' LineChart.AddLinePointData(lstSubject.Get(i), lstTotal.Get(i), True)
' Next
' LineChart.YAxisName = "marks"
' LineChart.DrawChart
End Sub