1 | using System;
|
---|
2 | using System.Data;
|
---|
3 | using System.Configuration;
|
---|
4 | using System.Collections.Generic;
|
---|
5 | using System.Web;
|
---|
6 | using System.Web.Security;
|
---|
7 | using System.Web.UI;
|
---|
8 | using System.Web.UI.WebControls;
|
---|
9 | using System.Web.UI.WebControls.WebParts;
|
---|
10 | using System.Web.UI.HtmlControls;
|
---|
11 | using YAxis=OpenFlashChart.YAxis;
|
---|
12 | using OpenFlashChart;
|
---|
13 |
|
---|
14 | public partial class datafile_yaxis : System.Web.UI.Page
|
---|
15 | {
|
---|
16 | protected void Page_Load(object sender, EventArgs e)
|
---|
17 | {
|
---|
18 | OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
---|
19 | List<double> data1 = new List<double>();
|
---|
20 | Random rand = new Random(DateTime.Now.Millisecond);
|
---|
21 | for (double i = 0; i < 12; i++)
|
---|
22 | {
|
---|
23 | data1.Add(rand.Next(30));
|
---|
24 | }
|
---|
25 |
|
---|
26 | OpenFlashChart.LineHollow line1 = new LineHollow();
|
---|
27 | line1.Values = data1;
|
---|
28 | line1.HaloSize = 0;
|
---|
29 | line1.Width = 2;
|
---|
30 | line1.DotSize = 5;
|
---|
31 |
|
---|
32 | line1.Tooltip = "提示:#val#";
|
---|
33 |
|
---|
34 | chart.AddElement(line1);
|
---|
35 |
|
---|
36 | chart.Title = new Title("line演示");
|
---|
37 | // chart.Y_Axis.SetRange(0, 35, 5);
|
---|
38 | // chart.Y_Axis.Stroke = 2;
|
---|
39 | chart.Y_Axis_Right = new YAxis();
|
---|
40 | chart.Y_Axis_Right.TickLength=5;
|
---|
41 | chart.Y_Axis_Right.Stroke = 10;
|
---|
42 | line1.AttachToRightAxis(true);
|
---|
43 | //chart.Y_Axis_Right.Steps = 4;
|
---|
44 | chart.Y_Axis_Right.SetRange(0,30,10);
|
---|
45 | //chart.Y_Axis_Right
|
---|
46 | chart.Tooltip = new ToolTip("全局提示:#val#");
|
---|
47 | chart.Tooltip.Shadow = true;
|
---|
48 | chart.Tooltip.Colour = "#e43456";
|
---|
49 | chart.Tooltip.MouseStyle = ToolTipStyle.CLOSEST;
|
---|
50 | Response.Clear();
|
---|
51 | Response.CacheControl = "no-cache";
|
---|
52 | Response.Write(chart.ToPrettyString());
|
---|
53 | Response.End();
|
---|
54 | }
|
---|
55 | }
|
---|