Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Winchart Date Grouping
posted

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 Sub

End Class