in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

bind datasource to webchart problem

Last post 06-09-2008 2:48 AM by C1_PatrickS. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-05-2008 12:18 AM

    bind datasource to webchart problem

    Hi there,

     I've some serious issue here regarding the webchart. I've try to bind an sqldatasource with webchart using the chart wizard. But whenever i attempt to select the desire datasource under the binding tab. The chart wizard will immediately exit. I've try to reinstall the webchart but still the issue remains. By the way, i'm using visual studio 2005 with ComponentOne Studio Enterprise 2006 v1 for dotNet2.0. Hope someone can shed some light into this problem. TQ

  • 06-09-2008 2:48 AM In reply to

    Re: bind datasource to webchart problem

    You will have to do dataBinding through the wizard after assigning DataSource to the control. Please assign your X and Y axis to the respective columns in your datasource.
     
    Also try the following build.
     
     
    If you want to do it thorugh code then please find the code below:
     

    Dim sql As String = "select * from products"

    Dim conn As String = "provider=… nwind.mdb" '

    Dim da As New OleDbDataAdapter(sql, conn)

    da.Fill(dt)

     

    ' bind chart to table (each series will bind to a field on the table)_
       c1chart.DataSource = dt

     

    ' clear data series collection

    Dim dsc As ChartDataSeriesCollection = c1chart.ChartGroups(0).ChartData.SeriesList

    dsc.Clear()

     

    ' add unit price series

    Dim ds As ChartDataSeries = dsc.AddNewSeries()

     

    'ds.AutoEnumerate = true' (in case you don't want to set the X values)

    ds.X.DataField = "ProductName"

    ds.Y.DataField = "UnitPrice"

     

    ' add units in stock series

    ds = dsc.AddNewSeries()

    ds.X.DataField = "ProductName"

    ds.Y.DataField = "UnitsInStock"

     

    ' apply filters, sorting, etc

    dt.DefaultView.RowFilter = "CategoryID = 4"

     

    Regards,
    Patrick 
    <chongws2006> wrote in message news:205596@10.0.1.98...

    Hi there,

     I've some serious issue here regarding the webchart. I've try to bind an sqldatasource with webchart using the chart wizard. But whenever i attempt to select the desire datasource under the binding tab. The chart wizard will immediately exit. I've try to reinstall the webchart but still the issue remains. By the way, i'm using visual studio 2005 with ComponentOne Studio Enterprise 2006 v1 for dotNet2.0. Hope someone can shed some light into this problem. TQ



    http://helpcentral.componentone.com/cs/forums/p/75464/205596.aspx#205596

Page 1 of 1 (2 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.