on lineChart values,frame
if frame is empty
then put insetRect(localRect(rect of card window),10) into frame
clearPicture frame
put itemArray(values) into values -- convert to comma separated list
put max(values) into maxValue
put number of items in values into valueCount
put item 3 of frame - item 1 of frame into frameWidth
put frameWidth/valueCount into valueWidth
put valueWidth/2 into margin
put item 1 of frame + margin into firstLeft
put item 4 of frame - item 2 of frame - 2 * margin into frameHeight
put item 4 of frame - margin into chartBottom
put 2 into pointSize
reset paint
set pattern to 12
set filled to true
repeat with i = 1 to valueCount
put firstLeft + (i - 1) * valueWidth into pointH
put item i of values / maxValue into ratio
put chartBottom - ratio * frameHeight into pointV
choose rect tool
set centered to true
drag from round(pointH),round(pointV) to ┬
round(pointH)+pointSize,round(pointV)+pointSize
if i is not 1 then
choose line tool
set centered to false
drag from round(oldH),round(oldV) to round(pointH),round(pointV)
end if
put pointH into oldH
put pointV into oldV
end repeat
choose browse tool
end lineChart
This article is adapted from the Claris Tech Info database.