#Region Project Attributes
#ApplicationLabel: MPLineChart
#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.
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 mlc1, mlc2, mlc3, mlc4 As LineChart
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")
' RIGHT_OF_CHART, RIGHT_OF_CHART_CENTER, RIGHT_OF_CHART_INSIDE,
' LEFT_OF_CHART, LEFT_OF_CHART_CENTER, LEFT_OF_CHART_INSIDE,
' BELOW_CHART_LEFT, BELOW_CHART_RIGHT, BELOW_CHART_CENTER,
' LINE, CIRCLE, SQUARE
mlc1.LegendShapeSize = 7.0 'this line of code needs to be before mlc1.setTheLegendPositionAndForm("BELOW_CHART_CENTER", "CIRCLE")
mlc1.setTheLegendPositionAndForm("BELOW_CHART_LEFT", "CIRCLE") 'pass strings from the above comments
mlc1.TheLegendColor = Colors.White
mlc1.TheLegendTextSize = 15.0
mlc1.LegendTitle = "Sine of x (x in degrees)"
mlc1.ChartDescription = "TITLE : A Sine Curve"
mlc1.ChartDescriptionColor = 0XFFFFA500 'ORANGE
mlc1.ChartDescriptionTextSize = 15
mlc1.ValueTextColor = Colors.Black
mlc1.ValueTextSize = 7.0
Dim myfloat(73) As Float
Dim myxvals(73) As String
Dim j As Int = 0
For i = 0 To 360 Step 5
myfloat(j) = SinD(i)
myxvals(j) = i
j = j + 1
Next
mlc1.LegendText = myxvals
mlc1.ChartData = myfloat
mlc1.DoubleTapToZoomEnabled = True
mlc1.GridBackgroundColor = Colors.white
mlc1.DrawBorders = True
mlc1.DrawGridBackground = True
mlc1.PinchZoom = True
mlc1.ScaleEnabled = True
mlc1.BorderColor = Colors.Red
mlc1.BorderWidth = 7.0
mlc1.DrawDashedLine = False
mlc1.DrawGraphHollowCircles = True
mlc1.DrawGraphValues = False
mlc1.GraphCircleSize = 3.0
mlc1.DrawAxisLine = True
mlc1.DrawXaxisGridLines = True
mlc1.DrawYaxisGridLines = True
mlc1.GraphLineColor = Colors.Yellow
mlc1.GraphLineWidth = 4.0
'TOP, BOTTOM, BOTH_SIDED, TOP_INSIDE, BOTTOM_INSIDE
mlc1.XaxisLabelPosition = "BOTTOM"
mlc1.XaxisTextColor = Colors.Magenta
mlc1.XaxisTextSize = 15.0
mlc1.YaxisTextColor = Colors.Green
mlc1.YaxisTextSize = 15.0
mlc1.LineData = 73 'this number must be the same as the number of elements in the above arrays
' RIGHT_OF_CHART, RIGHT_OF_CHART_CENTER, RIGHT_OF_CHART_INSIDE,
' LEFT_OF_CHART, LEFT_OF_CHART_CENTER, LEFT_OF_CHART_INSIDE,
' BELOW_CHART_LEFT, BELOW_CHART_RIGHT, BELOW_CHART_CENTER,
' LINE, CIRCLE, SQUARE
mlc2.LegendShapeSize = 7.0 'this line of code needs to be before mlc2.setTheLegendPositionAndForm("BELOW_CHART_CENTER", "CIRCLE")
mlc2.setTheLegendPositionAndForm("BELOW_CHART_CENTER", "SQUARE") 'pass strings from the above comments
mlc2.TheLegendColor = Colors.Magenta
mlc2.TheLegendTextSize = 15.0
mlc2.LegendTitle = "Cosine of x (x in degrees)"
mlc2.ChartDescription = "TITLE : A Cosine Curve"
mlc2.ChartDescriptionColor = Colors.Black
mlc2.ChartDescriptionTextSize = 15
mlc2.ValueTextColor = Colors.Black
mlc2.ValueTextSize = 7.0
Dim myfloat(73) As Float
Dim myxvals(73) As String
Dim j As Int = 0
For i = 0 To 360 Step 5
myfloat(j) = CosD(i)
myxvals(j) = i
j = j + 1
Next
mlc2.LegendText = myxvals
mlc2.ChartData = myfloat
mlc2.DoubleTapToZoomEnabled = True
mlc2.GridBackgroundColor = Colors.white
mlc2.DrawBorders = True
mlc2.DrawGridBackground = True
mlc2.PinchZoom = True
mlc2.ScaleEnabled = True
mlc2.BorderColor = Colors.Green
mlc2.BorderWidth = 5.0
mlc2.DrawDashedLine = False
mlc2.DrawGraphHollowCircles = False
mlc2.DrawGraphValues = False
mlc2.GraphCircleSize = 0.0
mlc2.DrawAxisLine = True
mlc2.DrawXaxisGridLines = True
mlc2.DrawYaxisGridLines = True
mlc2.GraphLineColor = Colors.Cyan
mlc2.GraphLineWidth = 2.0
'TOP, BOTTOM, BOTH_SIDED, TOP_INSIDE, BOTTOM_INSIDE
mlc2.XaxisLabelPosition = "TOP"
mlc2.XaxisTextColor = Colors.Red
mlc2.XaxisTextSize = 15.0
mlc2.YaxisTextColor = Colors.Yellow
mlc2.YaxisTextSize = 15.0
mlc2.LineData = 73 'this number must be the same as the number of elements in the above arrays
' RIGHT_OF_CHART, RIGHT_OF_CHART_CENTER, RIGHT_OF_CHART_INSIDE,
' LEFT_OF_CHART, LEFT_OF_CHART_CENTER, LEFT_OF_CHART_INSIDE,
' BELOW_CHART_LEFT, BELOW_CHART_RIGHT, BELOW_CHART_CENTER,
' LINE, CIRCLE, SQUARE
mlc3.LegendShapeSize = 7.0 'this line of code needs to be before mlc3.setTheLegendPositionAndForm("BELOW_CHART_CENTER", "CIRCLE")
mlc3.setTheLegendPositionAndForm("BELOW_CHART_RIGHT", "LINE") 'pass strings from the above comments
mlc3.TheLegendColor = Colors.Green
mlc3.TheLegendTextSize = 15.0
mlc3.LegendTitle = "Day of Week"
mlc3.ChartDescription = "TITLE : Arbitrary Data"
mlc3.ChartDescriptionColor = Colors.Yellow
mlc3.ChartDescriptionTextSize = 17
mlc3.ValueTextColor = Colors.Black
mlc3.ValueTextSize = 10.0
Dim myfloat() As Float = Array As Float(15.5, 59.2, -16.8, -36.3, 47.8, 5.7, 54.9)
Dim myxvals() As String = Array As String("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")
mlc3.LegendText = myxvals
mlc3.ChartData = myfloat
mlc3.DoubleTapToZoomEnabled = True
mlc3.GridBackgroundColor = Colors.White
mlc3.DrawBorders = True
mlc3.DrawGridBackground = True
mlc3.PinchZoom = True
mlc3.ScaleEnabled = True
mlc3.BorderColor = Colors.LightGray
mlc3.BorderWidth = 7.0
mlc3.DrawDashedLine = True
mlc3.DrawGraphHollowCircles = True
mlc3.DrawGraphValues = True
mlc3.GraphCircleSize = 9.0
mlc3.GraphCircleColor = Colors.Cyan
mlc3.DrawAxisLine = True
mlc3.DrawXaxisGridLines = True
mlc3.DrawYaxisGridLines = True
mlc3.GraphLineColor = Colors.Red
mlc3.GraphLineWidth = 7.0
'TOP, BOTTOM, BOTH_SIDED, TOP_INSIDE, BOTTOM_INSIDE
mlc3.XaxisLabelPosition = "TOP"
mlc3.XaxisTextColor = Colors.Blue
mlc3.XaxisTextSize = 14.0
mlc3.YaxisTextColor = Colors.White
mlc3.YaxisTextSize = 13.0
mlc3.LineData = 7 'this number must be the same as the number of elements in the above arrays
' RIGHT_OF_CHART, RIGHT_OF_CHART_CENTER, RIGHT_OF_CHART_INSIDE,
' LEFT_OF_CHART, LEFT_OF_CHART_CENTER, LEFT_OF_CHART_INSIDE,
' BELOW_CHART_LEFT, BELOW_CHART_RIGHT, BELOW_CHART_CENTER,
' LINE, CIRCLE, SQUARE
mlc4.LegendShapeSize = 7.0 'this line of code needs to be before mlc4.setTheLegendPositionAndForm("BELOW_CHART_CENTER", "CIRCLE")
mlc4.setTheLegendPositionAndForm("BELOW_CHART_CENTER", "CIRCLE") 'pass strings from the above comments
mlc4.TheLegendColor = Colors.Yellow
mlc4.TheLegendTextSize = 17.0
mlc4.LegendTitle = "Some Data"
mlc4.ChartDescription = "TITLE : Arbitrary Data"
mlc4.ChartDescriptionColor = Colors.DarkGray
mlc4.ChartDescriptionTextSize = 17
mlc4.ValueTextColor = Colors.Blue
mlc4.ValueTextSize = 15.0
Dim myfloat() As Float = Array As Float(31.0, -29.0, 67.0, -48.0, 83.0, -54.0, 60.0, -15.0, 37.0, -45.0, 68.0, -5.0)
Dim myxvals() As String = Array As String("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
mlc4.LegendText = myxvals
mlc4.ChartData = myfloat
mlc4.DoubleTapToZoomEnabled = True
mlc4.GridBackgroundColor = Colors.LightGray
mlc4.DrawBorders = True
mlc4.DrawGridBackground = True
mlc4.PinchZoom = True
mlc4.ScaleEnabled = True
mlc4.BorderColor = Colors.Green
mlc4.BorderWidth = 2.0
mlc4.DrawDashedLine = False
mlc4.DrawGraphHollowCircles = True
mlc4.DrawGraphValues = False
mlc4.GraphCircleSize = 4.0
mlc4.GraphCircleColor = Colors.Red
mlc4.DrawAxisLine = True
mlc4.DrawXaxisGridLines = True
mlc4.DrawYaxisGridLines = True
mlc4.GraphLineColor = Colors.DarkGray
mlc4.GraphLineWidth = 3.0
'TOP, BOTTOM, BOTH_SIDED, TOP_INSIDE, BOTTOM_INSIDE
mlc4.XaxisLabelPosition = "BOTH_SIDED"
mlc4.XaxisTextColor = Colors.White
mlc4.XaxisTextSize = 14.0
mlc4.YaxisTextColor = Colors.Blue
mlc4.YaxisTextSize = 13.0
mlc4.LineData = 12 'this number must be the same as the number of elements in the above arrays
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub