========================================================================
ASP.NET APPLICATION : CSASPNETChart Project Overview
========================================================================
/////////////////////////////////////////////////////////////////////////////
Use:
The project illustrates how to use the new Chart control to create an chart
in the web page.
/////////////////////////////////////////////////////////////////////////////
Code Logical:
Step1. Create a C# ASP.NET Web Application in Visual Studio 2010 RC /
Visual Web Developer 2010 and name it as CSASPNETChart.
[NOTE] As Visual Studio 2010 has not been realsed, you can download its
express version from http://www.microsoft.com/express/Web/
Step2. Delete the following default folders and files created automatically
by Visual Studio.
Account folder
Script folder
Style folder
About.aspx file
Default.aspx file
Global.asax file
Site.Master file
Step3. Add a new web form page to the website and name it as Default.aspx.
Step4. Add a Chart control into the page. You can find it in the Data
category of the Toolbox.
[NOTE] When a Chart control is added into the page, such a Register Info will
be added to the same page automatically.
<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
Also, a new reference /System.Web.DataVisualization/ will be added to the web
application as well.
Step5: Add two Series into the Chart tag as the sample below.
<Series>
<asp:Series Name="Series1">
</asp:Series>
<asp:Series Name="Series2">
</asp:Series>
</Series>
[NOTE] The Series collection property stores Series objects, which are used to
store data that is to be displayed, along with attributes of that data.
Step6: Edit the two Series to add ChartType property which equals to Column and
ChartArea property with the value as ChartArea1.
[NOTE] The Series ChartType value that indicates the chart type that will be
used to represent the series. For all items in this collectin, please refer
to this link: http://msdn.microsoft.com/en-us/library/system.web.ui.datavisualization.charting.seriescharttype(VS.100).aspx
The ChartAreas collection property stores ChartArea objects, which are primarily
used to draw one or more charts using one set of axes. You will finally find the
HTML code looks like this.
<asp:Chart ID="Chart1" runat="server" Height="400px" Width="500px">
<Series>
<asp:Series Name="Series1" ChartType="Column" ChartArea="ChartArea1">
</asp:Series>
<asp:Series Name="Series2" ChartType="Column" ChartArea="ChartArea1">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
Step7: Create data source for the Chart control via DataTable in the behind
code. In this step, please directly follow the method CreateDataTable in
Default.aspx.cs, as this is not what we are talking about in this project.
Step8: Bind the data source to the Chart control.
Chart1.Series[0].YValueMembers = "Volume1";
Chart1.Series[1].YValueMembers = "Volume2";
Chart1.Series[0].XValueMember = "Date";
[NOTE] Series.YValueMembers property is used to get or set member columns of
the chart data source used to bind data to the Y-values of the series. Alike,
Series.XValueMember property is for getting or setting the member column of
the chart data source used to data bind to the X-value of the series.
Step9: Now, you can run the page to see the achievement we did before :-)
/////////////////////////////////////////////////////////////////////////////
References:
MSDN: Chart Class
http://msdn.microsoft.com/en-us/library/system.web.ui.datavisualization.charting.chart(VS.100).aspx
MSDN: Chart Controls Tutorial
http://msdn.microsoft.com/en-us/library/dd489231(VS.100).aspx
ASP.NET: Chart Control
http://www.asp.net/learn/aspnet-4-quick-hit-videos/video-8770.aspx (Quick Hit Videl)
/////////////////////////////////////////////////////////////////////////////
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
VS2010 chart 控件 学习资料 (1478个子文件)
Global.asax 946B
legendcells.aspx 43KB
movingaverages.aspx 11KB
usinglabels.aspx 11KB
legendappearance.aspx 10KB
appearance.aspx 10KB
AxisVariableIntervals.aspx 10KB
zorder.aspx 9KB
retrievingassigningdates.aspx 9KB
imagemapcustomtooltip.aspx 9KB
seriesappearance.aspx 9KB
gridlinesandtickmarks.aspx 9KB
Palettes.aspx 8KB
charttitle.aspx 8KB
striplines.aspx 8KB
chartappearance.aspx 8KB
legendtitle.aspx 8KB
axistitle.aspx 8KB
ClickSample.aspx 8KB
legendcellspan.aspx 8KB
striplinestitle.aspx 8KB
multiplelegends.aspx 7KB
labelstextstyle.aspx 7KB
ttest.aspx 7KB
emptypointsappearance.aspx 7KB
anova.aspx 7KB
ClickEvent.aspx 7KB
legendstyleandposition.aspx 7KB
barcolumn3d.aspx 7KB
3dperspectives.aspx 7KB
annotationappearance.aspx 7KB
usingmarkers.aspx 7KB
ftest.aspx 7KB
borders.aspx 7KB
pointwidthanddepth.aspx 7KB
chartareaposition.aspx 7KB
appearance.aspx 7KB
pyramidchart.aspx 7KB
distributions.aspx 6KB
piecollected.aspx 6KB
funnelchart.aspx 6KB
volumeindicators.aspx 6KB
filteryvaluesrange.aspx 6KB
scalebreaks.aspx 6KB
bubblechart.aspx 6KB
annotationanchoring.aspx 6KB
smartlabels.aspx 6KB
multipletitles.aspx 6KB
usinggaps3d.aspx 6KB
ChartAsTrigger.aspx 6KB
imagemaptooltipsformating.aspx 6KB
datatablecustompainting.aspx 6KB
legendcustomizedefault.aspx 6KB
filterdaterange.aspx 6KB
filtertopn.aspx 6KB
technicalpriceindicators.aspx 6KB
descriptivestatistics.aspx 6KB
cylinder3d.aspx 6KB
filterwithcustomcriteria.aspx 6KB
boxplotchart.aspx 6KB
titlecustomposition.aspx 6KB
crossingandreverse.aspx 6KB
legendfont.aspx 6KB
groupingformulas.aspx 6KB
legendcellcolumns.aspx 6KB
antialiasingsample.aspx 6KB
striplinesoffset.aspx 6KB
tooltipdrilldown.aspx 6KB
logarithmicscale.aspx 6KB
seriesandchartareas.aspx 6KB
multilinelabels.aspx 6KB
labelsformatting.aspx 5KB
areachart3d.aspx 5KB
legendcustomposition.aspx 5KB
axislabelsinterval.aspx 5KB
forecasting.aspx 5KB
pie3d.aspx 5KB
combinatorialchart.aspx 5KB
serstatemanagement.aspx 5KB
annotationstyles.aspx 5KB
axisscale.aspx 5KB
histogram.aspx 5KB
errorbarchart.aspx 5KB
barcolumnchart.aspx 5KB
seriesaxis.aspx 5KB
chartarea3d.aspx 5KB
groupingstockdata.aspx 5KB
multiybubble.aspx 5KB
polarchart.aspx 5KB
SelectingChartTypes.aspx 5KB
annotationsmartlabels.aspx 5KB
rangecolumnchart.aspx 5KB
seriesalignment.aspx 5KB
financialchart.aspx 5KB
annotationpositioning.aspx 5KB
hidingseries.aspx 5KB
autofitaxeslabels.aspx 5KB
insertingemptypoints.aspx 5KB
multiplelegendswithcheckbox.aspx 5KB
preandpostpaintevent.aspx 5KB
共 1478 条
- 1
- 2
- 3
- 4
- 5
- 6
- 15
qq379797807
- 粉丝: 25
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页