[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 |
|
---|
| 14 | public partial class datafile_Candle : System.Web.UI.Page
|
---|
| 15 | {
|
---|
| 16 | protected void Page_Load(object sender, EventArgs e)
|
---|
| 17 | {
|
---|
| 18 | OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
---|
| 19 | chart.Title = new Title("Bar Chart");
|
---|
| 20 |
|
---|
| 21 | Candle candle = new OpenFlashChart.Candle();
|
---|
| 22 | Random random = new Random();
|
---|
| 23 | candle.Colour = "#345";
|
---|
| 24 |
|
---|
| 25 | candle.FillAlpha = 0.4;
|
---|
| 26 | candle.Text = "Test";
|
---|
| 27 |
|
---|
| 28 | candle.FontSize = 10;
|
---|
| 29 | ArrayList values = new ArrayList();
|
---|
| 30 | for (int i = 0; i < 12; i++)
|
---|
| 31 | values.Add(new CandleValue(random.Next(20,30),random.Next(15,20),random.Next(10,15),random.Next(5,10)));
|
---|
| 32 | candle.Values = values;
|
---|
| 33 | chart.AddElement(candle);
|
---|
| 34 | //XAxis xaxis = new XAxis();
|
---|
| 35 | //// xaxis.Labels = new AxisLabel("text","#ef0",10,"vertical");
|
---|
| 36 | //xaxis.Steps = 1;
|
---|
| 37 | //xaxis.Offset = true;
|
---|
| 38 | ////xaxis.SetRange(-2, 15);
|
---|
| 39 | //chart.X_Axis = xaxis;
|
---|
| 40 | //YAxis yaxis = new YAxis();
|
---|
| 41 | //yaxis.Steps = 4;
|
---|
| 42 | //yaxis.SetRange(0, 20);
|
---|
| 43 | //chart.Y_Axis = yaxis;
|
---|
| 44 |
|
---|
| 45 | chart.Y_Axis.SetRange(0, 24, 3);
|
---|
| 46 | candle.Tooltip = "提示:#top#<br>#bottom#<br>#val#";
|
---|
| 47 | string s = chart.ToPrettyString();
|
---|
| 48 |
|
---|
| 49 | Response.Clear();
|
---|
| 50 | Response.CacheControl = "no-cache";
|
---|
| 51 | Response.Write(s);
|
---|
| 52 | Response.End();
|
---|
| 53 | }
|
---|
| 54 | }
|
---|