1 | using System;
|
---|
2 | using System.Data;
|
---|
3 | using System.Configuration;
|
---|
4 | using System.Collections;
|
---|
5 | using System.Web;
|
---|
6 | using System.Web.Security;
|
---|
7 | using System.Web.UI;
|
---|
8 | using System.Web.UI.WebControls;
|
---|
9 | using System.Web.UI.WebControls.WebParts;
|
---|
10 | using System.Web.UI.HtmlControls;
|
---|
11 | using OpenFlashChart;
|
---|
12 |
|
---|
13 | public 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 | }
|
---|