[7849] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Data;
|
---|
| 4 | using System.Configuration;
|
---|
| 5 | using System.Collections;
|
---|
| 6 | using System.Web;
|
---|
| 7 | using System.Web.Security;
|
---|
| 8 | using System.Web.UI;
|
---|
| 9 | using System.Web.UI.WebControls;
|
---|
| 10 | using System.Web.UI.WebControls.WebParts;
|
---|
| 11 | using System.Web.UI.HtmlControls;
|
---|
| 12 | using OpenFlashChart;
|
---|
| 13 | using Bar=OpenFlashChart.Bar;
|
---|
| 14 | using ToolTip=OpenFlashChart.ToolTip;
|
---|
| 15 | using YAxis=OpenFlashChart.YAxis;
|
---|
| 16 |
|
---|
| 17 | public 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 | }
|
---|