Ok, so I am very new to Infragistics. I have a data-grid which displays the following information HOURS | OPERATION | BOARDS PROCESSED, I am needing to display this information via column chart. I can get the data to display no problem. However, with the current application that is being used the X-Axis displays the number of boards processed and the hour in which those numbers were given. For instance at 6AM there were 200 board processed on line 1. The chart would/should show 06:00 on the X-Axis and Y-Axis the number of boards processed. There is a stored procedure in place which is outlined below. The "Hour" just to the right of TxDate is what I am needing to display on the X-Axis, which as you can see for hour 1 shows 06:00. The screenshot attached shows what the chart currently looks like and what I am attempting to accomplish. Thanks for the help in advance.
--Shift 1, Line 1, Hour 1 INSERT INTO FactoryServerMES.dbo.HourlyProductionRate(Shift, Line,TxDate, Hour, OperationID, FriendlyName, BoardProcessed) SELECT @Shift, 1,@StartDate, '06:00', TX.OperationID, FriendlyName, COUNT(DISTINCT(CustomerLotID)) FROM fsWIPTxHist Tx INNER JOIN FactoryServerMES.dbo.fsOperation O ON TX.OperationID = O.OperationID WHERE customerlotid <> '5D25984G1412%' and (Tx.DateCreated BETWEEN @StartDate + '06:00:00' AND @StartDate + '06:59:59') AND (Status='Avail') AND TX.OperationID IN (@OperationTaskID) --group by Tx.OperationID GROUP BY TX.OperationID, FriendlyName
Chart code, I forgot to place in the previous post.
private void ChartData(string startDate, int shift, int productionLine, int operationTaskId, UltraChart ucChart) { SqlConnection cdConnection = new SqlConnection(FactoryServerMesdbConnection.ConnectToDatabase); SqlCommand cmd = new SqlCommand("dbo.HourlyProductionYield", cdConnection) { CommandType = CommandType.StoredProcedure, CommandText = "dbo.HourlyProductionYield", Connection = cdConnection }; //Adding values to StoredProcedure parameters. cmd.Parameters.AddWithValue("@StartDate", startDate); cmd.Parameters.AddWithValue("@Shift", shift); cmd.Parameters.AddWithValue("@Line", productionLine); cmd.Parameters.AddWithValue("@OperationTaskID", operationTaskId); cdConnection.Open(); using (SqlDataAdapter da = new SqlDataAdapter()) { //Clear series data ucL1SMT.Series.Clear(); DataTable dt = new DataTable(); da.SelectCommand = cmd; da.Fill(dt); ucL1SMT.DataSource = dt; ucL1SMT.DataBind(); ucL1SMT.Data.SwapRowsAndColumns = true; ucL1SMT.Data.IncludeColumn(dt.Columns["Shift"], false); ucL1SMT.Data.IncludeColumn(dt.Columns["Line"], false); ucL1SMT.Data.IncludeColumn(dt.Columns["OperationID"], false); cdConnection.Close(); } }
Hi Trent,
I'm a bit unclear on your requirement. From the looks of the chart, everything is displaying as you want it to. Is that chart you showed your application, or is it a mock-up?
Please let me know.
That chart is what is currently being used. I am rewriting the web application to use Infragistics. What happens when I run the application using Infragistics is the data grid appears as it should, similar to the one in the screensho. However, the column chart displays everything correct except the X Axis shows the date and time of 12:00 AM. I've tried using the IncludeColumn(dt.Columns["Hour"],true); without success. I will upload a screenshot tomorrow so you can see.
Here is the screenshot of the Infragistics chart showing the X Axis with the name of the numbers column. It should be the hours one. Please reference SQL statement in first couple posts.
I'm working on putting together a sample application that demonstrates how you can set up a chart the way you want using data similar to yours. I should have this ready for you tomorrow.
Please let me know if you have any questions.