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

Last change on this file since 7849 was 7849, checked in by dennisw, 15 years ago
File size: 2.2 KB
Line 
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_LineAnimtion : System.Web.UI.Page
14{
15 OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
16 OpenFlashChart.LineHollow line1 = new LineHollow();
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 if (temp > 20)
26 data1.Add(new LineDotValue(temp, "#fe0"));
27 else
28 {
29 data1.Add(temp);
30 }
31 }
32
33 line1.Values = data1;
34 line1.HaloSize = 0;
35 line1.Width = 2;
36 line1.DotSize = 5;
37
38 line1.Tooltip = "提示:#val#";
39
40 chart.AddElement(line1);
41
42 chart.Title = new Title("line演示");
43 chart.Y_Axis.SetRange(0, 35, 5);
44 chart.Tooltip = new ToolTip("全局提示:#val#");
45 chart.Tooltip.Shadow = true;
46 chart.Tooltip.Colour = "#e43456";
47 chart.Tooltip.MouseStyle = ToolTipStyle.CLOSEST;
48 OpenFlashChartControl1.EnableCache = false;
49 OpenFlashChartControl1.Chart = chart;
50 }
51 protected void Button1_Click(object sender, EventArgs e)
52 {
53 Animation animation = new Animation();
54 animation.Type = DropDownList1.SelectedValue;
55 try
56 {
57 animation.Cascade = double.Parse(TextBox1.Text);
58 }
59 catch (Exception)
60 {
61 TextBox1.Text = "1";
62 animation.Cascade = 1;
63 }
64 try
65 {
66 animation.Delay = double.Parse(TextBox2.Text);
67 }
68 catch (Exception)
69 {
70 TextBox2.Text = "0.5";
71 animation.Delay = 0.5;
72 }
73 line1.OnShowAnimation = animation;
74 OpenFlashChartControl1.Chart = chart;
75 }
76}
Note: See TracBrowser for help on using the repository browser.