Hi, I am Using V.7.2 win chart. I need to display drill down chart like yearly, quarterly, monthly, daily, hourly and so on. Is there any way to group the interval yearly, quarterly, monthly, daily, hourly automatically and i only need to return query such as example below instead of return date group by yearly or quarterly or monthly and so on. Thanks in advance
Sub CreateChart(ByRef Chart1 As Chart) 'set global properties Chart1.Title = "Sales" Chart1.TempDirectory = "temp" Chart1.Debug = True Chart1.DefaultSeries.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;user id=admin;password=;data source=database/chartsample.mdb" Chart1.DefaultSeries.StartDate = New System.DateTime(2002, 1, 1, 0, 0, 0) Chart1.DefaultSeries.EndDate = New System.DateTime(2002, 12, 31, 23, 59, 59) Chart1.DateGrouping = dotnetCHARTING.WinForms.TimeInterval.Quarter 'Add a series Chart1.Series.Name = "Order" Chart1.Series.SqlStatement = "SELECT OrderDate,Sum(Total) FROM Orders WHERE OrderDate >= #STARTDATE# AND OrderDate <= #ENDDATE# Group By OrderDate ORDER BY OrderDate" Chart1.SeriesCollection.Add() End SubEnd Class
i'm not sure what that DateGrouping property is supposed to do, but the best way to enable drill-down using WinChart is simply to handle the ChartDataClicked event and change the datasource in that event handler.
I think you missed the point of the question. The example shown is clearly from dundas which includes the ability to automatically group data based on time interval, something I dont think you do, rather you required the dataset be fully sliced/arranged before binding. To do what they want to do would require a "re grouping" of the data probably with a select statement, something unfortunately isn't supported on ado.net
I accomplished this by basically "re grouping" the datatable my self before rebinding.
Infragistics should probably take note that this is a very useful function for them to accomplish and would make their chart control a lot more usable and friendly for "quick" drop in as time sequencing data is a very common use. just a thought.