. Net language APP development platform-Smobiler Learning Log: How to Implement pie chart on mobile phones, too many er

Source: Internet
Author: User

. 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

Figure 4 Figure 5
Ii. Mobile phone effect display

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.