source: code/Website/dot-net-library/written-by-xiao-yifang/ofcWebTest/Animation/AreaAnimation.aspx.cs@ 7849

Last change on this file since 7849 was 7849, checked in by dennisw, 15 years ago
File size: 2.1 KB
RevLine 
[7849]1using System;
2using System.Data;
3using System.Configuration;
4using System.Collections;
5using System.Web;
6using System.Web.Security;
7using System.Web.UI;
8using System.Web.UI.WebControls;
9using System.Web.UI.WebControls.WebParts;
10using System.Web.UI.HtmlControls;
11using OpenFlashChart;
12
13public partial class Animation_AreaAnimation : System.Web.UI.Page
14{
15 OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
16 OpenFlashChart.Area area = new Area();
17
18 protected void Page_Load(object sender, EventArgs e)
19 {
20 ArrayList data1 = new ArrayList();
21 Random rand = new Random(DateTime.Now.Millisecond);
22 for (double i = 0; i < 12; i++)
23 {
24 int temp = rand.Next(30);
25 data1.Add(temp);
26
27 }
28
29 area.Values = data1;
30 area.HaloSize = 0;
31 area.Width = 2;
32 area.DotSize = 5;
33
34 area.Tooltip = "Tooltip:#val#";
35
36 chart.AddElement(area);
37
38 chart.Title = new Title("Area Animation Demo");
39 chart.Y_Axis.SetRange(0, 35, 5);
40 chart.Tooltip = new ToolTip("Global tip:#val#");
41 chart.Tooltip.Shadow = true;
42 chart.Tooltip.Colour = "#e43456";
43 chart.Tooltip.MouseStyle = ToolTipStyle.CLOSEST;
44 OpenFlashChartControl1.EnableCache = false;
45 OpenFlashChartControl1.Chart = chart;
46 }
47 protected void Button1_Click(object sender, EventArgs e)
48 {
49 Animation animation = new Animation();
50 animation.Type = DropDownList1.SelectedValue;
51 try
52 {
53 animation.Cascade = double.Parse(TextBox1.Text);
54 }
55 catch (Exception)
56 {
57 TextBox1.Text = "1";
58 animation.Cascade = 1;
59 }
60 try
61 {
62 animation.Delay = double.Parse(TextBox2.Text);
63 }
64 catch (Exception)
65 {
66 TextBox2.Text = "0.5";
67 animation.Delay = 0.5;
68 }
69 area.OnShowAnimation = animation;
70 OpenFlashChartControl1.Chart = chart;
71 }
72}
Note: See TracBrowser for help on using the repository browser.