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

Last change on this file since 7937 was 7849, checked in by dennisw, 15 years ago
File size: 1.8 KB
Line 
1using System;
2using System.Data;
3using System.Configuration;
4using System.Collections.Generic;
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;
12using XAxis=OpenFlashChart.XAxis;
13using YAxis=OpenFlashChart.YAxis;
14
15public partial class bar : System.Web.UI.Page
16{
17 protected void Page_Load(object sender, EventArgs e)
18 {
19 OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
20 chart.Title = new Title("Bar Chart");
21
22 Bar bar = new OpenFlashChart.Bar();
23 Random random = new Random();
24 bar.Colour = "#344565";
25
26 bar.Alpha = 0.8;
27
28 bar.Text = "Test";
29
30 bar.FontSize = 10;
31 List<object> values = new List<object>();
32 for (int i = 0; i < 12; i++)
33 values.Add(random.Next(i, i * 2));
34 BarValue barValue = new BarValue(12);
35 barValue.OnClick = "http://xiao-yifang.blogspot.com";
36 values.Add(barValue);
37 bar.Values = values;
38 chart.AddElement(bar);
39 XAxis xaxis = new XAxis();
40 xaxis.Labels.SetLabels(new string[] { "text", "#ef0", "10", "vertical" });
41 //xaxis.Steps = 1;
42 //xaxis.Offset = true;
43 ////xaxis.SetRange(-2, 15);
44 chart.X_Axis = xaxis;
45 //YAxis yaxis = new YAxis();
46 //yaxis.Steps = 4;
47 //yaxis.SetRange(0, 20);
48 //chart.Y_Axis = yaxis;
49 chart.Y_Axis.SetRange(0,24,3);
50 bar.Tooltip = "提示:label:#x_label#<br>#top#<br>#bottom#<br>#val#";
51 string s = chart.ToPrettyString();
52
53 Response.Clear();
54 Response.CacheControl = "no-cache";
55 Response.Write(s);
56 Response.End();
57 }
58}
Note: See TracBrowser for help on using the repository browser.