BBjCommonChart::clearData

Description

In BBj 7.0 and higher, this method clears all data from a BBjChart.

Syntax

Return Value

Method

void

clearData()

Parameters

None.

Return Value

None.

Remarks

None.

Example

rem 'Barchart demo: Graph Maximum Velocities for the Soapbox Derby

declare BBjLineChart lineChart!
declare BBjWindow win!
declare BBjSysGui sysgui!
declare BBjNumber sysguiChan
declare BBjSystemMetrics sysMetrics!
declare java.awt.Dimension screenDimension!
declare BBjNumber height
declare BBjNumber width
declare BBjNumber numSeries
declare BBjNumber numXPoints
declare BBjNumber series_ctr
declare BBjNumber xPoints_ctr

rem 'instantiate the window and chart to take up a quarter screen
sysguiChan = unt
open (sysguiChan) "X0"
sysgui! = BBjAPI().getSysGui()

sysMetrics! = sysgui!.getSystemMetrics()
screenDimension! = sysMetrics!.getScreenSize()
width = int(screenDimension!.getWidth()/2)
height = int(screenDimension!.getHeight()/2)

win! = sysgui!.addWindow(10,10,width,height,"BBjBarChart Sample")
win!.setCallback(win!.ON_CLOSE,"end_demo")

numSeries = 3
numXPoints = 20
lineChart! = win!.addLineChart(101,10,10,width-20,height-120,"X Axis","Y Axis",numSeries,0)
button! = win!.addButton(102,width/2 -30, height - 80, 60,40,"Clear data")
button!.setCallback(button!.ON_BUTTON_PUSH, "clearData")

lineChart!.setTitle("Soapbox Derby")
lineChart!.setXLabel("Time")
lineChart!.setYLabel("Velocity")

rem 'Populate the chart with data for each car and race.
for xPoints_ctr = 0 to numXPoints-1
    for series_ctr = 0 to numSeries-1
        lineChart!.setSeriesName(series_ctr,"Soapbox #"+str(series_ctr+1))
        lineChart!.setXYValue(series_ctr,XPoints_ctr,rnd(40))
    next series_ctr
next xPoints_ctr

print "The Chart's title is ",$22$,lineChart!.getTitle(),$22$
print "The Chart's X Label is ",$22$,lineChart!.getXLabel(),$22$
print "The Chart's Y Label is ",$22$,lineChart!.getYLabel(),$22$

process_events

clearData:
    lineChart!.clearData()
return

end_demo:
release

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

ClientObject Tutorial

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.