I have a chart with 2 series added to it. The first series is for total orders. The second series is the count of orders that are from repeat customers. I would like to add a 3rd series that is the calculated percentage. Basically just dividing the second series by the first one. I can't seem to figure out the syntax to make that work.
I am using the latest release from dotnetcharting.com
Dim sc As New SeriesCollection()
RepeatCustomers.Debug = True
RepeatCustomers.Title = "Repeat Customers"
RepeatCustomers.XAxis.FormatString = "MMMyy"
RepeatCustomers.LegendBox.Orientation = dotnetCHARTING.Orientation.Bottom
RepeatCustomers.DateGrouping = TimeInterval.Months
Dim sd As DateTime = New System.DateTime(2007, 5, 1, 0, 0, 0) '5/1/2007
Dim ed As DateTime = New System.DateTime(Year(Now), Month(Now), Day(Now), 23, 59, 59)
'Add a series
Dim sql As String = "SELECT OrderDate,1 AS q FROM Orders WHERE OrderDate >= '" & sd.ToString & "' AND OrderDate <= '" & ed.ToString & "' ORDER BY OrderDate"
Dim df As New Series()
df.ConnectionString = ConfigurationManager.AppSettings("DNCConnectionString").ToString
df.StartDate = sd
df.EndDate = ed
df.Type = SeriesType.Cylinder
df.DefaultElement.ShowValue = True
df.Name = "Total Orders"
df.SqlStatement = sql
df.DefaultElement.Transparency = 50
'repeat customer orders
Dim sql2 As String = "query selects quantity of orders from repeat customers)"
Dim rs As New Series()
rs.Name = "Repeats"
rs.SqlStatement = sql2
rs.DefaultElement.Transparency = 50
rs.Type = SeriesType.Cylinder
rs.DefaultElement.ShowValue = True
rs.ConnectionString = df.ConnectionString