Hi,
First add the DevExpress.Utils, DevExpress.XtraCharts and DevExpress.XtraCharts.UI assemblies to the References list of your project, and then use the following code or similar:
Imports System
Imports System.Data
Imports DevExpress.XtraCharts
' ...
Partial Public Class _Default
Inherits System.Web.UI.Page
Private Function CreateChartData(ByVal rowCount As Integer) As DataTable
' Create an empty table.
Dim Table As New DataTable("Table1")
' Add two columns to the table.
Table.Columns.Add("Argument", GetType(Int32))
Table.Columns.Add("Value", GetType(Int32))
' Add data rows to the table.
Dim Rnd As New Random()
Dim Row As DataRow = Nothing
Dim i As Integer
For i = 0 To rowCount - 1
Row = Table.NewRow()
Row("Argument") = i
Row("Value") = Rnd.Next(100)
Table.Rows.Add(Row)
Next i
Return Table
End Function
Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load
' Create a chart.
Dim Chart As New WebChartControl()
Chart.Height = 400
Chart.Width = 600
' Create an empty Pie series and add it to the chart.
Dim Series As New Series("Series1", ViewType.Pie)
Chart.Series.Add(Series)
' Generate a data table and bind the series to it.
Series.DataSource = CreateChartData(30)
' Specify data members to bind the series.
Series.ArgumentScaleType = ScaleType.Numerical
Series.ArgumentDataMember = "Argument"
Series.ValueScaleType = ScaleType.Numerical
Series.ValueDataMembers.AddRange(New String() {"Value"})
Me.Controls.Add(Chart)
End Sub
End Class
Does this help you?
@.
R&D, .NET Team.
PS. If you wish to receive direct assistance from our Support Team, use Support Center at http://www.devexpress.com/sc.