co_lcruz@axtel.com.mx Posted August 5, 2013 Report Share Posted August 5, 2013 Hi everyone, I try to do the example "sample crosstab" without success, i get the error "FieldUsage.RowHeading is required", it's my code: code behind: Dim myArray As New ArrayList myArray.Add(New MyCrossTabData(1004, New DateTime(2006, 1, 1), 10)) myArray.Add(New MyCrossTabData(1004, New DateTime(2006, 1, 2), 20)) myArray.Add(New MyCrossTabData(1004, New DateTime(2006, 1, 3), 70)) myArray.Add(New MyCrossTabData(1004, New DateTime(2006, 1, 4), 80)) myArray.Add(New MyCrossTabData(1005, New DateTime(2006, 1, 1), 30)) myArray.Add(New MyCrossTabData(1005, New DateTime(2006, 1, 2), 60)) myArray.Add(New MyCrossTabData(1005, New DateTime(2006, 1, 3), 45)) myArray.Add(New MyCrossTabData(1005, New DateTime(2006, 1, 4), 75)) myArray.Add(New MyCrossTabData(1005, New DateTime(2006, 1, 5), 30)) Dim crossTab As New ChartFX.WebForms.DataProviders.CrosstabDataProvider(New ListProvider(myArray)) crossTab.RowHeadingSettings = RowHeadingSettings.CompressedXValues Chart1.DataSourceSettings.Fields.Add(New FieldMap("Series", FieldUsage.ColumnHeading)) Chart1.DataSourceSettings.Fields.Add(New FieldMap("Date", FieldUsage.RowHeading)) Chart1.DataSourceSettings.Fields.Add(New FieldMap("Value", FieldUsage.Value)) Chart1.DataSource = crossTab // this throw error: "FieldUsage.RowHeading is required" my class: Public Class MyCrossTabData Private m_series As Integer Private m_date As DateTime Private m_value As Double Public Sub New(ByVal series As Integer, ByVal fecha As DateTime, ByVal value As Double) m_series = series m_date = fecha m_value = value End Sub Property Value() As Double Get Return m_value End Get Set(ByVal Value As Double) m_value = Value End Set End Property Property Series() As Integer Get Return m_series End Get Set(ByVal value As Integer) m_series = value End Set End Property Property DateTime() As DateTime Get Return m_date End Get Set(ByVal value As DateTime) m_date = value End Set End Property End Class in the front aspx: <chartfx7:Chart ID="Chart1" runat="server" Height="350px" Width="430px" RandomData-Points="0" RandomData-Series="0" BackColor="#FFFFFF" Palette="Mesa.Mesa" PlotAreaColor="255, 255, 255" > <SpecialObjects> <chartfxadornments:ImageBorder AssemblyName="ChartFX.WebForms.Adornments" Color="255, 255, 255" Type="Embed" /> <chartfxadornments:SolidBackground AssemblyName="ChartFX.WebForms.Adornments" /> <chartfx7galleries:Bar /> <chartfx7data:CrosstabDataProvider AssemblyName="ChartFX.WebForms.Data" /> </SpecialObjects> </chartfx7:Chart> Any advice, will be appreciated, tks peace, Quote Link to comment Share on other sites More sharing options...
AndreG Posted August 5, 2013 Report Share Posted August 5, 2013 The FieldMap has to have the field name as the first parameter. This is what it should look like (you have it as "Date"): Chart1.DataSourceSettings.Fields.Add(New FieldMap("DateTime", FieldUsage.RowHeading))But I would actually discourage you from naming one of the properties of your class as DateTime, since it is the same name as the type. MyDateTime maybe? Quote Link to comment Share on other sites More sharing options...
co_lcruz@axtel.com.mx Posted August 5, 2013 Author Report Share Posted August 5, 2013 You have right , I change the property name of my class and work, thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.