[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 AreaLine=OpenFlashChart.AreaLine;
|
---|
| 14 | using Legend=OpenFlashChart.Legend;
|
---|
| 15 |
|
---|
| 16 | public partial class datafile_area : System.Web.UI.Page
|
---|
| 17 | {
|
---|
| 18 | protected void Page_Load(object sender, EventArgs e)
|
---|
| 19 | {
|
---|
| 20 | OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
---|
| 21 | List<double> data1 = new List<double>();
|
---|
| 22 | Random rand = new Random(DateTime.Now.Millisecond);
|
---|
| 23 | for (double i = 0; i < 12; i++)
|
---|
| 24 | {
|
---|
| 25 | data1.Add(rand.Next(30));
|
---|
| 26 | }
|
---|
| 27 |
|
---|
| 28 | OpenFlashChart.Area area = new Area();
|
---|
| 29 | area.Values = data1;
|
---|
| 30 | area.HaloSize = 0;
|
---|
| 31 | area.Width = 2;
|
---|
| 32 | area.DotSize = 5;
|
---|
| 33 | area.FontSize = 12;
|
---|
| 34 | area.DotStyleType.Tip = "#x_label#<br>#val#";
|
---|
| 35 | //area.DotStyleType.Type = DotType.ANCHOR;
|
---|
| 36 | area.DotStyleType.Type = DotType.BOW;
|
---|
| 37 | area.DotStyleType.Colour = "#467533";
|
---|
| 38 | area.Tooltip = "提示:#val#";
|
---|
| 39 | area.Colour = "#CC3399";
|
---|
| 40 | area.FillColor = "#343399";
|
---|
| 41 | area.FillAlpha = .5;
|
---|
| 42 | chart.AddElement(area);
|
---|
| 43 | chart.Y_Legend = new Legend("中文test");
|
---|
| 44 | chart.Title = new Title("line演示");
|
---|
| 45 | chart.Y_Axis.SetRange(0, 35, 5);
|
---|
| 46 | chart.X_Axis.Labels.Color = "#e43456";
|
---|
| 47 | chart.X_Axis.Steps = 4;
|
---|
| 48 | chart.Y_Axis.Steps = 3;
|
---|
| 49 |
|
---|
| 50 | chart.Tooltip = new ToolTip("全局提示:#val#");
|
---|
| 51 | chart.Tooltip.Shadow = true;
|
---|
| 52 | chart.Tooltip.Colour = "#e43456";
|
---|
| 53 | chart.Tooltip.MouseStyle = ToolTipStyle.CLOSEST;
|
---|
| 54 | Response.Clear();
|
---|
| 55 | Response.CacheControl = "no-cache";
|
---|
| 56 | Response.Write(chart.ToPrettyString());
|
---|
| 57 | Response.End();
|
---|
| 58 | }
|
---|
| 59 | }
|
---|