I'm trying to do a project for working hours of employees for each day. This includes what time they start the product and when they finished. I succeded to do it manually. but I need to make it automatically from database.
'===================================================================================================
Dim series0 As New ChartSeries("WASTED", ChartSeriesType.StackingBar)
series0.Points.Add(8, [date]:="7:14")
series0.Points.Add(9, [date]:="7:14")
' series0.Style.Interior = New Syncfusion.Drawing.BrushInfo(Color.Red)
Me.ChartControl2.Series.Add(series0)
'===================================================================================================
Dim series1 As New ChartSeries("HTC 7020", ChartSeriesType.StackingBar)
start_time = "07:14:00"
end_time = "08:56:00"
time_calc()
series1.Points.Add(8, [date]:=TotalTime.ToString)
series1.Points.Add(9, [date]:=TotalTime.ToString)
Me.ChartControl2.Series.Add(series1)
'===================================================================================================
Dim series2 As New ChartSeries("WASTED", ChartSeriesType.StackingBar)
series2.Points.Add(8, [date]:="0:04:00")
series2.Points.Add(9, [date]:="0:04:00")
series2.Style.Interior = New Syncfusion.Drawing.BrushInfo(Color.Red)
Me.ChartControl2.Series.Add(series2)
'===================================================================================================
Dim series3 As New ChartSeries("HTC 7061", ChartSeriesType.StackingBar)
start_time = "09:00:00"
end_time = "10:00:00"
time_calc()
series3.Points.Add(8, [date]:=TotalTime.ToString)
series3.Points.Add(9, [date]:=TotalTime.ToString)
ChartControl2.Series.Add(series3)
'===================================================================================================
Dim series4 As New ChartSeries("BREAK", ChartSeriesType.StackingBar)
series4.Points.Add(8, [date]:=morning_break)
series4.Points.Add(9, [date]:=morning_break)
series4.Style.Interior = New Syncfusion.Drawing.BrushInfo(Color.White)
ChartControl2.Series.Add(series4)
'===================================================================================================
Dim series5 As New ChartSeries("HTC 7061", ChartSeriesType.StackingBar)
start_time = "10:15:00"
end_time = "12:45:00"
time_calc()
series5.Points.Add(8, [date]:=TotalTime.ToString)
series5.Points.Add(9, [date]:=TotalTime.ToString)
ChartControl2.Series.Add(series5)
'===================================================================================================
Dim series6 As New ChartSeries("Lunch Break", ChartSeriesType.StackingBar)
series6.Points.Add(8, [date]:=lunch_weekbreak)
series6.Points.Add(9, [date]:=lunch_weekbreak)
series6.Style.Interior = New Syncfusion.Drawing.BrushInfo(Color.White)
ChartControl2.Series.Add(series6)
'===================================================================================================
Dim series7 As New ChartSeries("HTC 7061", ChartSeriesType.StackingBar)
start_time = "13:30:00"
end_time = "15:45:00"
time_calc()
series7.Points.Add(8, [date]:=TotalTime.ToString)
series7.Points.Add(9, [date]:=TotalTime.ToString)
ChartControl2.Series.Add(series7)
'===================================================================================================
Dim series8 As New ChartSeries("NO INPUT", ChartSeriesType.StackingBar)
start_time = "15:45:00"
end_time = "17:30:00"
time_calc()
series8.Points.Add(8, [date]:=TotalTime.ToString)
series8.Points.Add(9, [date]:=TotalTime.ToString)
series8.Style.Interior = New Syncfusion.Drawing.BrushInfo(Color.Red)
ChartControl2.Series.Add(series8)
'===================================================================================================
Dim series9 As New ChartSeries("Evening Break", ChartSeriesType.StackingBar)
series9.Points.Add(8, [date]:=evening_break)
series9.Points.Add(9, [date]:=evening_break)
series9.Style.Interior = New Syncfusion.Drawing.BrushInfo(Color.White)
ChartControl2.Series.Add(series9)
'===================================================================================================
Dim series10 As New ChartSeries("Wasted", ChartSeriesType.StackingBar)
start_time = "18:00:00"
end_time = "18:09:00"
time_calc()
series10.Points.Add(8, [date]:=TotalTime.ToString)
series10.Points.Add(9, [date]:=TotalTime.ToString)
series10.Style.Interior = New Syncfusion.Drawing.BrushInfo(Color.Red)
ChartControl2.Series.Add(series10)
'===================================================================================================
Dim series11 As New ChartSeries("HTC 7128", ChartSeriesType.StackingBar)
start_time = "18:09:00"
end_time = "20:30:00"
time_calc()
series11.Points.Add(8, [date]:=TotalTime.ToString)
series11.Points.Add(9, [date]:=TotalTime.ToString)
ChartControl2.Series.Add(series11)
I need to take each date from database and match with the working times in that day for each series(product_no) and arrange it as per their start and finish time.
I had to double the input also with "9" because the bar will get thinner if it is only one value( STRANGE!).