[7849] | 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_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 | }
|
---|