In the code below, it creates a graph and runs it -- however, it shows a line "to zero" after the last data point.
ie: a day has 40 data points (7am to 5pm every 15 minutes there's a new data point)
Ok -- so at 8am there's only 5 data points (7,7:15,7:30, 7:45,8:00) but after the 8am data point, the line drops to zero.

I've tried saying there's only "5 data ponits" but then it graphs all the way across.
Anyone have an idea how to do this so it doesn't 'drop to zero'?
I would rather not try to draw a custom object line with a dynamically resized graph (unless I'm missing something, this task seems not as easy as it shoudl be)
Thanks
-josh
Code: Select all
nHours = 10
nDataPoints = nHours * 4
Dim aData(0)
Dim aGoal.d( nDataPoints )
For x = 0 To nDataPoints-1
aGoal(x) = 100
Next
nCount = 1
Dim aTotal.d(nCount)
aTotal(0)=0
OpenWindow(0, 393, 59, 780, 250, "Daily Income", #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
hParentDlg = WindowID(0)
RMC_CreateChart(hParentDlg,1,10,10,760,240,#ColorDefault,#RMC_CTRLSTYLE3D,#False,"","Tahoma", 0, #ColorDefault)
RMC_AddRegion(1,5,5,-5,-5,"",#False)
RMC_AddGrid(1,1,#ColorDefault,#False,0,0,0,0,#RMC_BICOLOR_NONE)
RMC_AddDataAxis(1,1,#RMC_DATAAXISLEFT,0,0,11,8,#ColorDefault,#ColorDefault,#RMC_LINESTYLESOLID,0,"$","","",#RMC_TEXTCENTER)
sTemp.s = "7**^**8**^**9**^**10**^**11**^**12**^**1**^**2**^**3**^**4**^**5"
RMC_AddLabelAxis(1,1, sTemp,1,nDataPoints,#RMC_LABELAXISBOTTOM,8,#ColorDefault,#RMC_TEXTCENTER,#ColorDefault,#RMC_LINESTYLESOLID,"")
RMC_AddLineSeries(1,1, @aData(0), 0,0,0,#RMC_LINE,#RMC_LINE_FLAT,#RMC_LSTYLE_LINE,#True,#ColorRed,#RMC_SYMBOL_NONE,1,#RMC_VLABEL_NONE,#RMC_HATCHBRUSH_OFF)
RMC_SetSeriesData(1,1,1,@aTotal(0),nDataPoints)
RMC_AddLineSeries(1,1, @aData(0), 0,0,0,#RMC_LINE,#RMC_LINE_FLAT,#RMC_LSTYLE_LINE,#True,#ColorRed,#RMC_SYMBOL_NONE,1,#RMC_VLABEL_NONE,#RMC_HATCHBRUSH_OFF)
RMC_SetSeriesData(1,1,2,@aGoal(0),nDataPoints)
RMC_Draw(1)
Repeat
h = WaitWindowEvent(1000)
If h = 0 And nCount < nDataPoints
Debug h
nCount+1
ReDim aTotal(nCount)
aTotal(nCount-1) = aTotal(nCount-2)+Int(Random(10))
RMC_SetSeriesData(1,1,1,@aTotal(0),nDataPoints)
RMC_Draw(1)
EndIf
If h = #PB_Event_CloseWindow
CloseWindow(0)
Break
EndIf
ForEver
