1 // The demo is beautiful. The extracted parameters are as follows:
2 chart1.borderskin. skinstyle = borderskinstyle. emboss; // rounded corner. Shadow includes emboss, raised, and sunken.
3 chart1.width = unit. pixel (500); // After the width and height are set, the graph in it will automatically increase or decrease accordingly.
4 chart1.antialiasing = antialiasingstyles. graphics; // This option appears to be used by default.
5 chart1.backcolor = system. Drawing. color. fromargb (211,223,240); // color scheme in the example
6 chart1.backgradientstyle = gradientstyle. topbottom;
7
8 // generate a chart at runtime
9 // chart
10 chart1.width = unit. pixel (800 );
11 // Title
12 chart1.titles. Add ("chart title ");
13 // lengend
14 legend L1 = chart1.legends. Add ("L1 ");
15 l1.backcolor = system. Drawing. color. Transparent; // The graphic area is transparent.
16 // Area
17 chartarea a1 = chart1.chartareas. Add ("CA1 ");
18 ca1.backcolor = system. Drawing. color. transparent;
19 // series
20 series S1 = chart1.series. Add ("Reservation quantity ");
21 series S2 = chart1.series. Add ("total income ");
22 s1.charttype = seriescharttype. stackedcolumn;
23 s2.charttype = seriescharttype. stackedcolumn;
24 // *** important. This section cannot be found during design. You can only write code at runtime ****//
25 S1 ["drawingstyle"] = "Cylinder"; // cylinder, emboss, lighttodark, wedge, default
26 S2 ["drawingstyle"] = "Cylinder ";
27 //******//
28 s1.labelforecolor = system. Drawing. color. White; // label color
29 // ***** pay attention to the usage of the third parameter ****//
30 s1.points. databind (DV, "hospital_name", "reserve_count", "tooltip = reserve_count, label = reserve_count ");
31 s2.points. databind (DV, "hospital_name", "reserve_sum", "tooltip = reserve_sum, label = reserve_sum ");
32
33 // ****** Note: When a value on the X axis is hidden, all values on the X axis are displayed *****//
34 ca1.axisx. interval = 1;
35
36 // partial presentation of pie chart and donut chart
37 chartarea Ca 2 = chart2.chartareas. Add ("ca 2 ");
38 ca2.backcolor = system. Drawing. color. transparent;
39 series ss2 = chart2.series. Add ("test ");
40 ss2.charttype = seriescharttype. doughnut;
41 ss2.points. databind (DV, "hospital_name", "reserve_count", "tooltip = reserve_count ");
42 // ****** pay attention to the usage of the following functions *****//
43 ss2.label = "# percent ";
44 // s2.tooltip = "# Valy {c}"; // The above databind has already been set. This is another way to manage
45 ss2.legendtext = "# valx"; // here we use different values for the legend and label (All values are X by default). Both values are directly set on series.
46 ss2.legendtooltip = "# percent ";
47 // ******* for details about how to use custom parameters, see *********//
30 // http://msdn.microsoft.com/en-us/library/dd456764.aspx
49 ss2.customproperties = "doughnutradius = 75, piedrawingstyle = concave, minimumrelativepiesize = 20, labelstyle = inside ";
50 // piedrawingstyle values include default, softedge, and concave;
51 ss2.backgradientstyle = gradientstyle. diagonalleft; // image gloss, gradient, (3D is invalid)
52 // ss2.backhatchstyle = charthatchstyle. forwarddiagonal; // image Shading
53 // ss2.bordercolor = system. drawing. color. red; // visible. The series attribute applies to each part of the image, for example, each part of a pie, and each legend. In this example, a border is added for each part.
54 ss2.labelforecolor = system. Drawing. color. Black; // label text color
55 // ss2.labelbackcolor = system. Drawing. color. White; // label text background color to prevent text from being the same as the image text color
56 ss2.palette = chartcolorpalette. brightpastel; // Color Scheme
57
58 // guides
59 system. Drawing. Color linecolor = system. Drawing. color. fromargb (100,150,200 );
60 c31.axisx. majorgrid. linecolor = linecolor; // the color of the X axis guides, which is perpendicular to the X axis.
61 c31.axisy. majorgrid. linecolor = linecolor;
62 c31.axisx. majortickmark. linecolor = linecolor; // scale Color of the X axis
63 c31.axisy. majortickmark. linecolor = linecolor;
64 c31.axisx. linecolor = linecolor; // X axis color
65 c31.axisy. linecolor = linecolor;