source: code/Website/dot-net-library/written-by-xiao-yifang/ofcWebTest/datafile/GlassBar.aspx.cs@ 7937

Last change on this file since 7937 was 7849, checked in by dennisw, 15 years ago
File size: 1.7 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Data;
4using System.Configuration;
5using System.Collections;
6using System.Web;
7using System.Web.Security;
8using System.Web.UI;
9using System.Web.UI.WebControls;
10using System.Web.UI.WebControls.WebParts;
11using System.Web.UI.HtmlControls;
12using OpenFlashChart;
13using Bar=OpenFlashChart.Bar;
14using ToolTip=OpenFlashChart.ToolTip;
15using YAxis=OpenFlashChart.YAxis;
16
17public partial class datafile_GlassBar : System.Web.UI.Page
18{
19 protected void Page_Load(object sender, EventArgs e)
20 {
21 OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
22 chart.Title = new Title("Bar Chart");
23
24 BarGlass bar = new OpenFlashChart.BarGlass();
25 Random random = new Random();
26 bar.Colour = "#345";
27
28 bar.FillAlpha = 0.4;
29 bar.Text = "Test";
30
31 bar.FontSize = 10;
32 List<BarGlassValue> values = new List<BarGlassValue>();
33 for (int i = 0; i < 11; i++)
34 {
35
36 values.Add(new BarGlassValue(random.Next(i, i * 2)));
37 }
38 BarGlassValue barGlassValue = new BarGlassValue(4);
39 barGlassValue.Tip = "#bottom#:top#top#<br>#val#";
40 barGlassValue.Color = "#eee";
41 values.Add(barGlassValue);
42 bar.Values = values;
43 chart.AddElement(bar);
44 YAxis yaxis = new YAxis();
45 yaxis.Steps = 4;
46 yaxis.SetRange(0, 20);
47 chart.Y_Axis = yaxis;
48 chart.Y_Axis.SetRange(0, 24, 3);
49 chart.Tooltip = new ToolTip("提示:#val#");
50 string s = chart.ToPrettyString();
51
52 Response.Clear();
53 Response.CacheControl = "no-cache";
54 Response.Write(s);
55 Response.End();
56 }
57}
Note: See TracBrowser for help on using the repository browser.