. Net language APP development platform-Smobiler Learning Log: How to Implement pie chart on mobile phones, too many er
Smobiler is a development platform that uses the. Net language to develop apps in the VS environment. It may be more convenient than Xamarin.
1. Target Style
The following operations are required to achieve the effect:
1. Drag a PieChart control from "scycler Components" on the toolbar to the form interface.
2. Modify the attributes of PieChart a. CenterText
Show the text "1236.00 consumption amount" in the middle of the table, 1
B. DefaultColors attributes
Open the Set Editor and click Add. 2. Figure 3
|
|
|
Figure 1 |
Figure 2 |
Figure 3 |
C. Load event (add data)
VB: Private Sub TestChart2_Load (sender As Object, e As EventArgs) Handles MyBase. load Dim matTable As New DataTable matTable. columns. add ("XMember", GetType (String) matTable. columns. add ("YMember", GetType (Integer) For I As Integer = 1 To 4 Step 1 Dim row As DataRow = matTable. newRow matTable. rows. add (row) Next matTable. rows (0) ("XMember") = "catering" matTable. rows (1) ("XMember") = "accommodation" matTable. rows (2) ("XMember") = "Long Distance" matTable. rows (3) ("XMember") = "" matTable. rows (0) ("YMember") = 740.0 matTable. rows (1) ("YMember") = 280.0 matTable. rows (1) ("YMember") = 147.0 matTable. rows (3) ("YMember") = 69.0 Me. pieChart1.DataSource = matTable Me. pieChart1.DataBind () End Sub
C #: private void TestChart2_Load (object sender, EventArgs e) {DataTable matTable = new DataTable (); matTable. columns. add ("XMember", typeof (string); matTable. columns. add ("YMember", typeof (int); for (int I = 1; I <= 4; I + = 1) {DataRow row = matTable. newRow (); matTable. rows. add (row);} matTable. rows [0] ["XMember"] = "catering"; matTable. rows [1] ["XMember"] = "accommodation"; matTable. rows [2] ["XMember"] = "Long Distance"; matTable. rows [3] ["XMember"] = ""; matTable. rows [0] ["YMember"] = 740.0; matTable. rows [1] ["YMember"] = 280.0; matTable. rows [2] ["YMember"] = 147.0; matTable. rows [3] ["YMember"] = 69.0; this. pieChart1.DataSource = matTable; this. pieChart1.DataBind ();}
D. XAxisLabelMember attributes
Value bound to the X axis, 4
E. YAxisLabelMember attributes
Value bound to the Y axis, 5
Ii. Mobile phone effect display