Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

Chart layout question

Last post 07-21-2008 16:27 by [Infragistics] Max Rivlin. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-15-2008 17:39

    • Kjan
    • Not Ranked
    • Joined on 07-15-2008
    • Points 65

    Chart layout question

    Hello,

    This is my first attempt to use the UltraChart component and I have not found what I am looking for in the documentation. I am using NetAdvantage for .NET 2008 Vol. 1 CLR 2.0 with ASP and VB.  I have the chart datasource bound to a dataset that uses a stored procedure in SQL Server.  The code for that is :

     

    Me.UltraChart1.DataSource = ds10

    Me.UltraChart1.DataBind()

    Me.UltraChart1.Visible = True

     

     I am using the following code to call the dataset:

    Public Function GetRevenueSummaryByMonth(ByVal ClaimYear As Integer, ByVal Region As String) As Data.DataSet

    Dim SqlConnect As New SqlConnection(DsnCodeMaker)

    Dim SqlCommand As SqlCommand

    Dim SqlDataAdapter As SqlDataAdapter

    Dim SqlDataSet As Data.DataSetSqlCommand = New SqlCommand("procGetRevenueSummaryByMonth", SqlConnect)

    SqlCommand.CommandType = Data.CommandType.StoredProcedure

    SqlCommand.Parameters.Add("@ClaimYear", Data.SqlDbType.Int)

    SqlCommand.Parameters("@ClaimYear").Value = ClaimYear

    SqlCommand.Parameters("@ClaimYear").Direction = Data.ParameterDirection.Input

    SqlCommand.Parameters.Add("@Region", Data.SqlDbType.VarChar, 3)

    SqlCommand.Parameters("@Region").Value = Region

    SqlCommand.Parameters("@Region").Direction = Data.ParameterDirection.InputSqlDataAdapter = New SqlDataAdapter

    SqlDataAdapter.SelectCommand = SqlCommand

    SqlDataSet = New Data.DataSet

    SqlDataAdapter.Fill(SqlDataSet, "GetRevenueSummaryByMonth")

    SqlConnect.Close()

    Return SqlDataSet

     

    I know the dataset call works as I am using it to fill a datagrid.  But I also want to create a simple column chart of the data returned in that dataset.

    The dataset has 14 columns: Region, Location, and one for each month.  The first 2 are strings and the rest are currency. 

    I want the graph to group the locations by region and show the revenue for each month.  Only a single year's data is returned in the dataset. 

    How do I tell it to layout the data?

     

    Any help would be appreciated. 

    K.

    Filed under:
    • Post Points: 20
  • 07-17-2008 13:45 In reply to

    Re: Chart layout question

    Sorry, but the chart does not group values the way the grid does. I'm guessing that you have some repeating values in the Region column and you wanted to group the currencies based on that. Binding a chart to this data would only work if each row represented a unique region. In other words the column values in each row are grouped into one series. Each column on the chart represents a value from one of the columns in the data. The number of columns within each series must be the same. In order to group by the region, you would have to loop through the datatable and create a new table that already has all the grouping and follows the format described here:
    http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Chart_Working_with_2D_Column_Chart_Data.html

    • Post Points: 20
  • 07-17-2008 14:11 In reply to

    • Kjan
    • Not Ranked
    • Joined on 07-15-2008
    • Points 65

    Re: Chart layout question

    Thanks for your reply. 

    My original data is in a different format.  I have written a new stored procedure to give me the data that has a total of 6 columns.  Region, Location number, location description, ClaimYear, ClaimMonth, and Revenue.  I want to chart the revenue by location which is within a region for each month.  The ClaimYear and ClaimMonth field are derived from a datetime field.  If it would be better to use the original datetime format, that would be good to know.  Most of the columns will be used for labels.  The actual data to be charted is in the Revenue column.

    I am having trouble finding out how to code the axes so that the chart populates.  I understand that the Month will be a series. Within that series will be the Region as another series and within that will be a column for each location that denotes the revenue.  The bottom example on the link you sent me is very close to what I want.  I just don't know what commands to use to get it.  I have been pouring through the help pages and can't seem to find an example of the VB code that will let me do it. 

     Hopefully this explains it better.  I would really appreciate any help you can give me.

    Thanks again,

    K.

    Filed under:
    • Post Points: 20
  • 07-21-2008 16:27 In reply to

    Re: Chart layout question

    So you want a chart that looks like the one in the image from the help link but with additional level of grouping? If so, then unfortunately, the chart does not support that. Data point are grouped into series, but series cannot be grouped into anything. You can submit a feature request for such functionality here:
    http://devcenter.infragistics.com/Protected/RequestFeature.aspx

    If I'm not understanding this right, can you please include a picture of what you're looking for?

    • Post Points: 5
Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems