📄 correlation.aspx
字号:
<%@ Page Language="VB" Description="dotnetCHARTING Component" %>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<HTML>
<HEAD>
<TITLE>.netCHARTING Sample</TITLE>
<script runat="server">
Sub Page_Load(sender As [Object], e As EventArgs)
' This sample demonstrates the use of LeastSquaresRegressionLineX and LeastSquaresRegressionLineY from
' within Correlation class
' The Correlation Chart
CorrelationChart.Title = "Correlation"
CorrelationChart.TempDirectory = "temp"
CorrelationChart.Debug = True
CorrelationChart.Size = "600x400"
CorrelationChart.LegendBox.Template = "%icon %name"
CorrelationChart.XAxis.Scale = Scale.Normal
CorrelationChart.TitleBox.Position = TitleBoxPosition.FullWithLegend
CorrelationChart.DefaultSeries.DefaultElement.Marker.Visible = False
CorrelationChart.DefaultSeries.Type = SeriesType.Spline
' Generate the sample data.
Dim scorrelation As New SeriesCollection()
Dim sampledata1 As New Series("Sample 1")
Dim b As Integer
For b = 1 To 9
Dim el As New Element()
el.YValue = - Math.Sin(b) - b
el.XValue = b
sampledata1.Elements.Add(el)
Next b
scorrelation.Add(sampledata1)
CorrelationChart.SeriesCollection.Add(scorrelation)
' Here we create a series which describe the regression line of Y on X using the
' method of least squares
CorrelationChart.SeriesCollection.Add(StatisticalEngine.LeastSquaresEstimateY("EstimateY", sampledata1))
' Here we create a series which describe the regression line of X on Y using the
' method of least squaresLeastSquaresEstimatex
Dim estimateX As Series = StatisticalEngine.LeastSquaresEstimateX("EstimateX", sampledata1)
estimateX.DefaultElement.Color = Color.FromArgb(255, 99, 49)
CorrelationChart.SeriesCollection.Add(estimateX)
End Sub 'Page_Load
</script>
</HEAD>
<BODY>
<DIV align="center">
<dotnet:Chart id="CorrelationChart" runat="server"/>
</dotnet:Chart>
</DIV>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -