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

Last change on this file since 7937 was 7849, checked in by dennisw, 15 years ago
File size: 2.1 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 AreaLine=OpenFlashChart.AreaLine;
14using DotType=OpenFlashChart.DotType;
15using ToolTip=OpenFlashChart.ToolTip;
16using ToolTipStyle=OpenFlashChart.ToolTipStyle;
17
18public partial class datafile_NumFormat : System.Web.UI.Page
19{
20 protected void Page_Load(object sender, EventArgs e)
21 {
22 OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
23 List<double> data1 = new List<double>();
24 Random rand = new Random(DateTime.Now.Millisecond);
25 for (double i = 0; i < 12; i++)
26 {
27 data1.Add(rand.Next(30));
28 }
29
30 OpenFlashChart.Area area = new Area();
31 area.Values = data1;
32 area.HaloSize = 0;
33 area.Width = 2;
34 area.DotSize = 5;
35 area.DotStyleType.Tip = "#x_label#<br>#val#";
36 //area.DotStyleType.Type = DotType.ANCHOR;
37 //area.DotStyleType.Type = DotType.BOW;
38 area.DotStyleType.Colour = "#467533";
39 area.Tooltip = "提示:#val#";
40
41 chart.AddElement(area);
42 chart.Y_Legend = new Legend("中文test");
43 chart.Title = new Title("line演示");
44 chart.Y_Axis.SetRange(0, 30000,10000);
45 chart.X_Axis.Labels.Color = "#e43456";
46 chart.X_Axis.Steps = 4;
47
48
49 //num format
50 chart.IsDecimalSeparatorComma = true;
51 chart.NumDecimals = 3;
52 chart.IsFixedNumDecimalsForced = true;
53
54 chart.Tooltip = new ToolTip("全局提示:#val#");
55 chart.Tooltip.Shadow = true;
56 chart.Tooltip.Colour = "#e43456";
57 chart.Tooltip.MouseStyle = ToolTipStyle.CLOSEST;
58 Response.Clear();
59 Response.CacheControl = "no-cache";
60 Response.Write(chart.ToPrettyString());
61 Response.End();
62 }
63}
Note: See TracBrowser for help on using the repository browser.