Silverlight Visifire Control chart making--silverlight background method ControlChart.xaml.cs

Source: Internet
Author: User
Tags silverlight

First, the construction method Controlchart

1, the foreground page control assigns the value

Time drop-down box assignment, drop-down box assigns selected value
for (int II = DateTime.Today.Year; II >= 1980; ii--)
{
String item = String. Format ("{0} years", Ii. ToString ());
THIS.DATEYEAR.ITEMS.ADD (item);
if (item = = sclickreportdate)
{
This.dateYear.SelectedValue = sclickreportdate;//drop-down box assigns the selected value
}
}

2, page place name drop-down box bound data, drop-down box to assign the selected value
String str = "Daqing, Jilin, Liaohe, Huabei, Dagang, Jidong, Zhejiang, Xinjiang";

string[] address = str. Split (', ');
for (int i = 0; i < address. Length; i++)
{
THIS.ADDRESSNAMELIST.ITEMS.ADD (Address[i]);
if (address[i] = = ChartTitle)
{
This.addressNameList.SelectedValue = charttitle;//drop-down box assigns the selected value
}
}

3. Adjust page layout
This.dateStart.Visibility = visibility.collapsed;//does not display controls
this.dateYear.Visibility = visibility.visible;//Display control
This.addressName.Margin =New Thickness (167, 16, 0, 0);//Location
This.addressNameList.Margin = new Thickness (212, 12, 0, 0);
This.btnDown.Margin = new Thickness (322, 12, 0, 0);
This.dtName.Margin = new Thickness (412, 16, 0, 0);
This.showData.Margin = new Thickness (470, 18, 0, 0);

4. Query method (call WCF to get paint information)

Query ();

private void Query ()
{
Dbserviceclient svc = new Dbserviceclient (); Call the WCF

Commissioned
Svc. getsinglechartdatacompleted + = new Eventhandler<getsinglechartdatacompletedeventargs> (svc_ getsinglechartdatacompleted);
Calling WCF's Getsinglechartdata method

(For more information, please refer to the blog: Silverlight Visifire control chart making--WCF)

Svc. Getsinglechartdataasync (Strreportdate, Strendreportdate, Stnameclick, sxname);

}

5. Printing

(For more information, please refer to the blog: Silverlight Visifire control chart making--silverlight background method print http://www.cnblogs.com/xuxin-1989/p/3819686.html)

6. Delegation method

private void Svc_getsinglechartdatacompleted (object sender, Getsinglechartdatacompletedeventargs e)
{

Get the WCF return value
observablecollection<listitem> Lbaseoilbar = E.result;

Drawing
Createchart (This.gridvisifire, Lbaseoilbar);

}

7, drawing method (please refer to blog: Silverlight Visifire control chart making--silverlight background method drawing method)

8. Page Events

(For more information, please refer to the blog: Silverlight Visifire control chart making--silverlight background Method page event http://www.cnblogs.com/xuxin-1989/p/3819773.html)

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.