User (Legacy) Posted April 26, 2006 Report Share Posted April 26, 2006 Hi, I am trying to create a simple XY chart from a recordset and I am having problems with the result. The recordset consists of 3 records and 7 fields, the first field is ignored for plotting because it is the description of series that is being plotted. Here is the code I have: CfxData.ResultSet = rsPassedGraphdata .DataType(0) = CDT_LABEL .DataType(1) = CDT_VALUE .DataType(2) = CDT_XVALUE .OpenDataEx COD_VALUES, rsPassedGraphdata.RecordCount, rsPassedGraphdata.Fields.count .OpenDataEx COD_XVALUES, rsPassedGraphdata.RecordCount, rsPassedGraphdata.Fields.count rsPassedGraphdata.MoveFirst For i = 0 To rsPassedGraphdata.RecordCount - 1 For j = 1 To rsPassedGraphdata.Fields.count - 1 .Series(i).Yvalue(j - 1) = IIf(Trim(rsPassedGraphdata.Fields(j).Value) = "", "0", rsPassedGraphdata.Fields(j).Value) .Series(i).Xvalue(j - 1) = j Next j .SerLeg(i) = Trim(rsPassedGraphdata.Fields(0).Value) rsPassedGraphdata.MoveNext Next i .SerLegBox = True Set SerLegBox = .SerLegBoxObj SerLegBox.Moveable = False SerLegBox.BorderStyle = BBS_FLAT SerLegBox.Docked = TGFP_FIXED ' Center vertically SerLegBox.Left = .Width - SerLegBox.Width - 8 SerLegBox.Top = .Height / 2 - SerLegBox.Height / 2 .RightGap = SerLegBox.Width + 8 SerLegBox.Visible = True rsPassedGraphdata.MoveFirst For i = 0 To rsPassedGraphdata.Fields.count - 2 .Axis(AXIS_X).Label(i) = Left(rsPassedGraphdata.Fields.Item(i + 1).Name, 5) Next i Somehow my results get an extra column with zeros for the values. Also, I can not get the legend to appear anywhere on the output. The legend button is enabled in the menu bar, but will not show up. Thanks for the help in advance. Joe Glen Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.