[7849] | 1 | using System;
|
---|
| 2 | using System.Data;
|
---|
| 3 | using System.Configuration;
|
---|
| 4 | using System.Collections;
|
---|
| 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 OpenFlashChart;
|
---|
| 12 | public partial class datafile_linedot : System.Web.UI.Page
|
---|
| 13 | {
|
---|
| 14 | protected void Page_Load(object sender, EventArgs e)
|
---|
| 15 | {
|
---|
| 16 | OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
---|
| 17 | ArrayList data1 = new ArrayList();
|
---|
| 18 | Random rand = new Random(DateTime.Now.Millisecond);
|
---|
| 19 | for (double i = 0; i < 12; i++)
|
---|
| 20 | {
|
---|
| 21 | int temp = rand.Next(30);
|
---|
| 22 | if (temp > 20)
|
---|
| 23 | data1.Add(new LineDotValue(temp, "your tip","#fe0fe0"));
|
---|
| 24 | else
|
---|
| 25 | {
|
---|
| 26 | data1.Add(temp);
|
---|
| 27 | }
|
---|
| 28 | }
|
---|
| 29 | LineDotValue dotValue1 = new LineDotValue(rand.Next(30));
|
---|
| 30 | dotValue1.Sides = 3;
|
---|
| 31 |
|
---|
| 32 | dotValue1.DotType = DotType.HOLLOW_DOT;
|
---|
| 33 | data1.Add(dotValue1);
|
---|
| 34 | LineDotValue dotValue2 = new LineDotValue(rand.Next(30));
|
---|
| 35 | dotValue2.IsHollow = true;
|
---|
| 36 | dotValue2.DotType = DotType.STAR;
|
---|
| 37 | data1.Add(dotValue2);
|
---|
| 38 |
|
---|
| 39 | LineDotValue dotValue3 = new LineDotValue(rand.Next(30));
|
---|
| 40 | dotValue3.Sides = 4;
|
---|
| 41 |
|
---|
| 42 | dotValue3.DotType = DotType.DOT;
|
---|
| 43 | data1.Add(dotValue3);
|
---|
| 44 | OpenFlashChart.LineHollow line1 = new LineHollow();
|
---|
| 45 | line1.Values = data1;
|
---|
| 46 | line1.HaloSize = 0;
|
---|
| 47 | line1.Width = 2;
|
---|
| 48 | line1.DotSize = 5;
|
---|
| 49 |
|
---|
| 50 | line1.Tooltip = "提示:#val#";
|
---|
| 51 |
|
---|
| 52 | chart.AddElement(line1);
|
---|
| 53 |
|
---|
| 54 | chart.Title = new Title("line演示");
|
---|
| 55 | chart.Y_Axis.SetRange(0, 35, 5);
|
---|
| 56 | chart.Tooltip = new ToolTip("全局提示:#val#");
|
---|
| 57 | chart.Tooltip.Shadow = true;
|
---|
| 58 | chart.Tooltip.Colour = "#e43456";
|
---|
| 59 | chart.Tooltip.MouseStyle = ToolTipStyle.CLOSEST;
|
---|
| 60 | Response.Clear();
|
---|
| 61 | Response.CacheControl = "no-cache";
|
---|
| 62 | Response.Write(chart.ToPrettyString());
|
---|
| 63 | Response.End();
|
---|
| 64 | }
|
---|
| 65 | }
|
---|