Report statistics (9) Access Database pie diagram Ajax Interaction

Source: Internet
Author: User

View code

 1   Public   Partial   Class  Webform3: system. Web. UI. Page  2   {  3           Protected   Void Page_load ( Object  Sender, eventargs E)  4   { 5   Createchart ();  6   }  7           Public   Void  Createchart ()  8   {  9 Chart1.width = 400  ;  10 Chart1.height = 300  ; 11 Chart1.backcolor = Color. Azure;  12 Chart1.chartareas [ 0 ]. Backcolor = Color. Gray;  13 Chart1.series [ 0 ]. Charttype = seriescharttype. Pie; //  Pie Chart  14 Chart1.series [ 0 ]. Postbackvalue = "  # Index " ; //  Data point index  15 Chart1.series [ 0 ]. Legendpostbackvalue = "  # Index  " ; //  Data point index  16 Chart1.series [ 0 ]. Legendtooltip = "  # Percent  " ; //  Percentage of data point y  17 Chart1.series [ 0 ]. Tooltip = "  # Valx: \ t # Valy  "  ;  18               Int [] Intarr = New   Int [] { 100 , 200 , 400 ,80  };  19               String [] Strarr = New   String [] { "  A  " , "  B  " , "  C  " , "  D "  };  20 Chart1.series [ 0  ]. Points. databindxy (strarr, intarr );  21 Legend L = New  Legend ();  22   Chart1.legends. Add (L );  23               If (! Ispostback)  24 Chart1.series [0 ]. Points [ 0 ]. Customproperties = "  Exploded = true  "  ;  25   }  26   27           Protected   Void Chart1_click ( Object  Sender, imagemapeventargs E)  28   { 29               Int Index = Convert. toint32 (E. postbackvalue );  30               If (Index> = 0 & Index <chart1.series [ 0  ]. Points. Count)  31   {  32 Chart1.series [ 0 ]. Points [Index]. customproperties + = " Exploded = true  "  ;  33   }  34   }  35   36 }
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.