in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

xtrachart in runtime

Last post 9/12/2008 8:34 AM by Alan (Developer Express). 7 replies.
Page 1 of 1 (8 items)
Sort Posts:
Previous Next
  • 8/23/2007 2:45 AM

    xtrachart in runtime

    hi, I am using asp.net2.0.How to create a xtrachart in runtime.help me..
  • 8/23/2007 3:26 AM In reply to

    Re: xtrachart in runtime

    Hello,

    Sorry that we're still of no help in preparing an example for you. I may prepare one. Please, tell me what language you are using (C# or VB)?

    Also note that this newsgroup is peer-to-peer. If you want to get an official 24-hour answer from our Support Team, it's always better to write to them directly at http://www.devexpress.com/sc.

    @.
    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.
  • 8/23/2007 4:09 AM In reply to

    Re: xtrachart in runtime

    HI, I am using vb.
  • 8/23/2007 5:24 AM In reply to

    Re: xtrachart in runtime

    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.
  • 8/23/2007 5:45 AM In reply to

    Re: xtrachart in runtime

    HI, If i give dim chart as new webchartcontrol() in page_load event it says webcontrolchart() is not there.Is there any alternate declaration.
  • 8/23/2007 6:02 AM In reply to

    Re: xtrachart in runtime

    karuna jo:
    it says webcontrolchart() is not there
     

    Sorry, what particular error are you getting? Also, what XtraCharts version are you using?

    Probably, you could send your project to our Support Team at http://www.devexpress.com/sc, so that we can replicate your problem locally and 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.
  • 9/11/2008 7:44 PM In reply to

    Re: xtrachart in runtime

    Hi Alan.

    I've a question, how can i rotate the chart ex. Bars or Lines from horizontal to vertical ?

  • 9/12/2008 8:34 AM In reply to

    Re: xtrachart in runtime

    Hi Ernesto,

    To rotate a chart you need to set the ChartControl.Diagram.Rotated property to True.

    At runtime it can be done as follows:
    C#: ((DevExpress.XtraCharts.XYDiagram)chartControl1.Diagram).Rotated = true;
    VB: CType(chartControl1.Diagram, DevExpress.XtraCharts.XYDiagram).Rotated = True

    @.
    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.
Page 1 of 1 (8 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED