Front: Smobiler is a development platform that uses. NET language to develop apps in the VS environment, perhaps more convenient than Xamarin
Style one by one, target style
We want to achieve the effect in the following actions:
1. Drag a Linechart control to the form interface from "Smobiler components" on the toolbar
2. Modify the properties of the Linechart A.defaultcolors property
Open the Collection Editor and click Add, 1, Figure 2
B.load event (add data)
Vb:PrivateSub testchart4_load (sender as Object, e AsEventArgs) Handles MyBase. Load DimMattable as NewDataTableMATTABLE.COLUMNS.ADD ("Xmember",GetType (string)) MATTABLE.COLUMNS.ADD ( "Ymember", gettype (integer)) for span class= "str" >i as Integer = 1 to 7 Step 1 Dim Row as datarow = mattable.newrow row ( "xmember") = "10-" + (i + 25). ToString Row ( "ymember") = 0 matTable.Rows.Add (row) Next mattable.rows (0) ( "ymember") = 3 Mattable.rows (1) ( "ymember") = 1 mattable.rows (3) ( " Ymember ") = 1 mattable.rows (6) (" xmember ") = " 11-01 " Me.LineChart1.DataSource = mattable me.linechart1.databind () End Sub
C#:private voidTestchart4_load (ObjectSenderEventArgsE{ DataTablemattable = newDataTable();mattable.columns.add ( "Xmember", typeof ( string)); MATTABLE.COLUMNS.ADD ( "Ymember", typeof (int)); for (int i = 1; I <= 7; i + = 1) {datarow row = Mattable.newrow ( ); Row[ "xmember"] = "10-" + (i + 25). ToString (); Row[ "ymember"] = 0; MatTable.Rows.Add (row), Mattable.rows[0][ "ymember"] = 3; Mattable.rows[1][ "ymember"] = 1; Mattable.rows[3][ "ymember"] = 1; Mattable.rows[6][ "xmember"] = "11-01"; this. Linechart1.datasource = mattable; this. Linechart1.databind (); /span>
C.xaxislabelmember Property
The value of the bound x-axis, 3
D.yaxislabelmember Property
The value of the bound y-axis, 4
Second, the mobile phone effect display
. NET Language app development platform--smobiler Learning log: How to implement a linear chart in mobile app development