Friday, January 14, 2005

netCharting in asp.net

Use netCharting, produced by the canadians team developpers, to generate and display
the advanced charts in ASP.NET application.



The code source here under in vb.net displays a bar chart which displays the
unit stock for each product.

<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING" %>
script runat="server"

Sub Page_Load()
Dim objSeries As New Series()
objSeries.ConnectionString = "server=localhost;uid=sa;pwd=secret;database=Northwind"
objSeries.SqlStatement = "SELECT ProductName, UnitsInStock FROM Products"
myChart.SeriesCollection.Add( objSeries )
myChart.Title = "Units in Stock"
End Sub

/script

dotnet:Chart id="myChart" runat="Server" /

No comments: