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

📄 trendlinepolynomial.aspx

📁 掌握学习.net开发的非常好的资料
💻 ASPX
字号:
<%@ Page Language="C#" Debug="true" Description="dotnetCHARTING Component" %>
<%@ Register TagPrefix="dotnet"  Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<%@ Import Namespace="dotnetCHARTING"%>
<HTML>
	<HEAD>
		<TITLE>.netCHARTING Forecasting Sample</TITLE>
		<script runat="server">

void Page_Load(Object sender,EventArgs e)
{
	// This sample demonstrates the use of TrendLine Forecasting engine in order to
	// find the function of best fit for the seventh degree polynom. The data used for which
	// the polynom is fit is a set of data which represents a FX exchange rate over a given
	// period of time. 

	// The Forecast Chart
	ForecastChart.Title="Exchange";
	ForecastChart.TempDirectory="temp";
	ForecastChart.Debug=true;
	ForecastChart.Size = "1000x800";
	ForecastChart.LegendBox.Template ="%icon %name";
	
	ForecastChart.YAxis.ScaleRange.ValueLow = 220;
	//ForecastChart.XAxis.Scale = Scale.Normal;
	
	// The Forecast data
	DataEngine de = new DataEngine ();
	de.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;data source=" + Server.MapPath("../../database/chartsample.mdb");
	de.DateGrouping = TimeInterval.Days;
	de.StartDate = new DateTime(1983,3,10,0,0,0);
	de.EndDate = new DateTime(1984,12,10,23,59,59);
	de.SqlStatement= @"SELECT ID, Value AS q FROM Exchange WHERE Data >= #STARTDATE# AND Data <= #ENDDATE# ORDER BY Data ";

	//Add a series
	SeriesCollection scForecast = de.GetSeries ();
	ForecastChart.SeriesCollection.Add (scForecast);

	scForecast[0].Name = "Exchange";
	scForecast[0].Type = SeriesType.Spline;

	/*
	 * Takes off the marker off the line and spline series.
	 */
	ForecastChart.DefaultSeries.DefaultElement.Marker = new ElementMarker (ElementMarkerType.None);
	ForecastChart.ChartAreaLayout.Mode = ChartAreaLayoutMode.Vertical;
	
	// We generate the best fitting curve of a 7th degree polynom.
	Series trendLine =  new Series();
	trendLine = ForecastEngine.TrendLinePolynomial(scForecast[0], 7);
	trendLine.Name = "7th Degree Polynomial";
	trendLine.Type = SeriesType.Spline;
	ForecastChart.SeriesCollection.Add(trendLine);
}
		</script>
	</HEAD>
	<BODY>
		<DIV align="center">
			
			<dotnet:Chart id="ForecastChart" runat="server"/>
			</dotnet:Chart>
			
		</DIV>
	</BODY>
</HTML>

⌨️ 快捷键说明

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