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 DotType=OpenFlashChart.DotType;
|
---|
15 | using ToolTip=OpenFlashChart.ToolTip;
|
---|
16 | using ToolTipStyle=OpenFlashChart.ToolTipStyle;
|
---|
17 |
|
---|
18 | public 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 | }
|
---|