I am attempting to draw a xy scatter chart with a trendline.
Here is the code:
For the statement nRetVal = RMC_CalcTrend(%ID_RMC1,1,1,nFirst,nLast,nL,nT,nR,nB), the nRetVal returns -31.
Must a COLine object be defined first?
How do I go about it?
Thanks.
Here is the code:
Code:
IF nRetVal < 0 THEN GOTO IsError '****** Set name and parameters for the X-datafile for series 1 ****** nRetVal = RMC_SetSeriesDataFile(%ID_RMC1,1,1,"W:\projects\BOB\Applied Linear Regression\Table2-1\TABLE2-1.CSV","0,0","2",",",%FALSE) IF nRetVal < 0 THEN GOTO IsError '****** Set name and parameters for the Y-datafile for series 1 ****** nRetVal = RMC_SetSeriesDataFile(%ID_RMC1,1,1,"W:\projects\BOB\Applied Linear Regression\Table2-1\TABLE2-1.CSV","0,0","3",",",%TRUE) IF nRetVal < 0 THEN GOTO IsError [B] ' Now, calc the trend: LOCAL nFirst,nLast AS DOUBLE LOCAL nL,nT,nR,nB AS LONG nRetVal = RMC_CalcTrend(%ID_RMC1,1,1,nFirst,nLast,nL,nT,nR,nB) IF nRetVal < 0 THEN GOTO IsError ' Of course you could use nFirst and nLast to add a line series to show the trend, ' but it's more convenient to use nL, nT, nR and nB for drawing the line with a ' CustomObject line: nRetVal = RMC_CODash(%ID_RMC1,1,nL,nT,nR,nB,%RMC_LINE_FLAT_DASH,IIF(nFirst>nLast,_ %ColorRed,%ColorGreen),0,2,0,%RMC_ANCHOR_ARROW_CLOSED) IF nRetVal < 0 THEN GOTO IsError[/B]
Must a COLine object be defined first?
How do I go about it?
Thanks.
Comment