Click here to Skip to main content
16,022,418 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
My script displays Time in X axis and Day_of_week in the Y axis. My script displays multiple columns for each day_of_week i.e. there are five 5x2 (start_time and end_time) columns for Monday and each column has Monday as the Y axis label. I would like to group those columns to display one day_of_week name in the Y axis label.

Could someone please help.

Here is my code.

MSIL
select cycle,day_of_week, start_time, end_time from df_qfs_time_logs order by day_of_week
cycle                            day_of_week              start_time end_time
-------------------------------- ------------------------ ---------- ---------
EARLY MORNING                    FRIDAY                   09:03:00   09:18:00
MORNING                          FRIDAY                   10:58:00   11:14:00
NOON                             FRIDAY                   12:38:00   12:52:00
AFTERNOON                        FRIDAY                   14:48:00   15:03:00
LATE AFTERNOON                   FRIDAY                   16:47:00   17:03:00
END OF DAY                       FRIDAY                   20:45:00   21:10:00
END OF DAY                       MONDAY                   23:35:00   23:59:00
LATE AFTERNOON                   MONDAY                   16:48:00   17:04:00
AFTERNOON                        MONDAY                   14:53:00   15:08:00
NOON                             MONDAY                   12:43:00   12:58:00
MORNING                          MONDAY                   10:38:00   10:53:00
EARLY MORNING                    MONDAY                   07:58:00   08:12:00
EARLY MORNING                    THURSDAY                 07:48:00   08:00:00
MORNING                          THURSDAY                 10:33:00   10:46:00
NOON                             THURSDAY                 12:32:00   12:46:00
AFTERNOON                        THURSDAY                 14:37:00   14:51:00
LATE AFTERNOON                   THURSDAY                 16:37:00   16:52:00
END OF DAY                       THURSDAY                 21:00:00   21:23:00
END OF DAY                       TUESDAY                  21:00:00   21:23:00
EARLY MORNING                    TUESDAY                  07:53:00   08:07:00
MORNING                          TUESDAY                  10:43:00   10:57:00
NOON                             TUESDAY                  12:48:00   13:02:00
AFTERNOON                        TUESDAY                  14:53:00   15:07:00
LATE AFTERNOON                   TUESDAY                  16:47:00   17:03:00
EARLY MORNING                    WEDNESDAY                07:53:00   08:07:00
MORNING                          WEDNESDAY                10:43:00   10:57:00
AFTERNOON                        WEDNESDAY                14:53:00   15:07:00
NOON                             WEDNESDAY                12:39:00   12:53:00
LATE AFTERNOON                   WEDNESDAY                16:47:00   17:03:00
END OF DAY                       WEDNESDAY                21:00:00   21:25:00


XML
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:Chart ID="Chart1" runat="server">
        <legends>
            <asp:Legend Name="legend" />
        </legends>
        <series>
            <asp:Series Name="Series1" YValueType="Time" />
             <asp:Series Name="Series2" YValueType="Time" />
       </series>
        <chartareas>
            <asp:ChartArea Name="ChartArea1">
            
        </chartareas>
    
    <asp:Button ID="btnChart" runat="server" Text="Click" OnClick="btnChart_onclick" />
    <asp:Label ID="LblResponse" runat="server" />



Protected Sub loadchartdata()
    Dim strcmd As String = "select RTRIM(day_of_week) as DAYS,RTRIM(convert(time,start_delivery)) as START, RTRIM(convert(time,end_delivery))as ENDT from df_delivery_time order by day_of_week, start_delivery"
    Dim da As New SqlDataAdapter(strcmd, dbconn)
    Dim table As New DataTable()
    da.Fill(table)
    Dim dv As DataView = table.DefaultView
    Chart1.Series("Series1").Points.DataBindXY(dv, "cycle", dv, "START")
    Chart1.Series("Series2").Points.DataBindXY(dv, "cycle", dv, "ENDT")
    Chart1.Series("Series1").ChartType = SeriesChartType.Column
    Chart1.Series("Series2").ChartType = SeriesChartType.Column
    Chart1.Series(0).XValueType = DataVisualization.Charting.ChartValueType.DateTime
End Sub
Posted

I was able to resolve my issue.
Thx
 
Share this answer
 
Comments
#realJSOP 17-Feb-11 15:35pm    
Well, tell us what you did! Edit your original question with the solution, and while you're there, put "[SOLVED]" at the beginning of the question title.
Take a look and try to resolve, hope it will help you out:
Microsoft Chart with ASP.NET 3.5 – Part 1
Microsoft Chart with ASP.NET 3.5 – Part 2
 
Share this answer
 
Comments
ajmiester 16-Feb-11 15:41pm    
Thank you, but I checked that site and it does not provide the information I am looking for.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900