⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 g03.aspx

📁 掌握学习.net开发的非常好的资料
💻 ASPX
字号:
<%@ Page Language="C#" Description="dotnetCHARTING Component"%>
<%@ Register TagPrefix="dotnet"  Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<%@ Import Namespace="System.Drawing" %>


<script runat="server">

		private SeriesCollection getData()
		{
			SeriesCollection SC = new SeriesCollection();
			Random myR = new Random();
			for(int i = 0; i < 1; i++)
			{


				Series s = new Series();
				s.Name = "X Company";			
				double startPrice = 50;

				DateTime startDT = new DateTime(2000,1,1);
				for(int b = 0; b < 75; b++)
				{
					Element e = new Element();
					e.XDateTime = startDT;
					startDT = startDT.AddDays(1);
					e.Open = startPrice;					

					if(myR.Next(10) > 5)
						startPrice += myR.Next(5);
					else
						startPrice -= myR.Next(3);
					

					e.Close = startPrice;
					

					e.Volume = myR.Next(100);
					
					
					if(e.Open > e.Close)
					{
						e.High = e.Open + myR.Next(6);
						e.Low = e.Close - myR.Next(6);
					}
					else
					{
						e.High = e.Close + myR.Next(6);
						e.Low = e.Open - myR.Next(6);
					}



					s.Elements.Add(e);

				}

				SC.Add(s);

			}
			return(SC);


		}


void Page_Load(Object sender,EventArgs e)
{
	// Set the title.
	Chart.Title="My Chart";

	// Set 3D
	Chart.Use3D = true;

	// Set the chart Type
	Chart.Type = ChartType.Financial;

	// Label the chart areas
	Chart.PriceArea.Label.Text = "Stock Price for X Company";
	Chart.VolumeArea.Label.Text = "Volume";

	// Set the financial chart type
	Chart.DefaultSeries.Type = SeriesTypeFinancial.Bar;

	// Set the legend template
	Chart.LegendBox.Template = "IconName";			


	// Set the directory where the images will be stored.
	Chart.TempDirectory="temp";

	// Set the format
	Chart.VolumeArea.XAxis.FormatString = "d";

	// Set the time padding for the x axis.
	Chart.VolumeArea.XAxis.TimePadding = new TimeSpan(5,0,0,0);


	// Set he chart size.
	Chart.Width = 600;
	Chart.Height = 350;

	// Add the random data.
	Chart.SeriesCollection.Add(getData());
    
    
}
</script>
<HTML><HEAD><TITLE>Gallery Sample</TITLE></HEAD>
<BODY>
<DIV align=center>
 <dotnet:Chart id="Chart"  runat="server"/>
</DIV>
</BODY>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -