ASP.NET Chart and Graph

  • Thread starter Thread starter SeePee
  • Start date Start date
S

SeePee

I am using Microsoft Visual Studio 2008 and need to know the most popular
method of creating charts and graphs. Also if you could supply an example.

Many thanks
 
Mark,

I have downloaded and installed Microsoft Chart Controls Add-on for
Microsoft Visual Studio 2008 -
http://www.microsoft.com/downloads/...13-E1E5-4315-825C-F14D33A303E9&displaylang=en

I then created a new project in MS Visual Studio 2008 and added the Chart
control to a form however it does not show any chart or data when I run it in
debug.

This is the code in my default.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb"
Inherits="Report_Test._Default" %>

<%@ Register assembly="System.Web.DataVisualization, Version=3.5.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>

Chart Example 1</div>
<asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSourceReport1">
<series>
<asp:Series Name="Series1">
</asp:Series>
</series>
<chartareas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</chartareas>
</asp:Chart>
<asp:SqlDataSource ID="SqlDataSourceReport1" runat="server"
ConnectionString="<%$ ConnectionStrings:PADSConnectionString %>"
SelectCommand="SELECT [Currency], [FXRate] FROM [tlkpCurrency]">
</asp:SqlDataSource>
</form>
</body>
</html>

I want to show the currency and its FXRate
 
Mark,

I have now sorted this problem and can now run the chart locally, however is
does not work on our host’s server.

Do they need to install anything on there server for it to work?

Many Thanks

SeePee said:
Mark,

I have downloaded and installed Microsoft Chart Controls Add-on for
Microsoft Visual Studio 2008 -
http://www.microsoft.com/downloads/...13-E1E5-4315-825C-F14D33A303E9&displaylang=en

I then created a new project in MS Visual Studio 2008 and added the Chart
control to a form however it does not show any chart or data when I run it in
debug.

This is the code in my default.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb"
Inherits="Report_Test._Default" %>

<%@ Register assembly="System.Web.DataVisualization, Version=3.5.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>

Chart Example 1</div>
<asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSourceReport1">
<series>
<asp:Series Name="Series1">
</asp:Series>
</series>
<chartareas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</chartareas>
</asp:Chart>
<asp:SqlDataSource ID="SqlDataSourceReport1" runat="server"
ConnectionString="<%$ ConnectionStrings:PADSConnectionString %>"
SelectCommand="SELECT [Currency], [FXRate] FROM [tlkpCurrency]">
</asp:SqlDataSource>
</form>
</body>
</html>

I want to show the currency and its FXRate
-----------------------------------------------------------------------------------------------
Mark Rae said:
 
Hi SeePee,

Firstly, we need to make sure the host server has installed .NET Framework
3.5 SP1. Then, APS.NET chart control add-one is a must. Otherwise the code
cannot find the Chart dll to load and no graph will be displayed.

In addition, if you need samples of how to use APS.NET chart controls,
please download the code package from
http://code.msdn.microsoft.com/mschart. For more information, please refer
to Scott Gu¡¯s blog at
http://weblogs.asp.net/scottgu/archive/2008/11/24/new-asp-net-charting-contr
ol-lt-asp-chart-runat-quot-server-quot-gt.aspx


--
Sincerely,
Zhi-Qiang Ni
Microsoft Online Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

MSDN Managed Newsgroup support offering is for non-urgent issues where an
initial response from the community or a Microsoft Support Engineer within
2 business day is acceptable. Please note that each follow up response may
take approximately 2 business days as the support professional working with
you may need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations that require urgent,
real-time or phone-based interactions. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
 
Back
Top