<pre>on barChart values,filledFlag,frame  if frame is empty  then put insetRect((rect of cd window),10) into frame  put itemArray(values) into values  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 3/4 * valueWidth into barWidth  put (valueWidth-barWidth)/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 barBottom  reset paint  set filled to filledFlag is true  set pattern to 14  choose rect tool  repeat with i = 1 to valueCount    put firstLeft + (i - 1) * valueWidth into barLeft    put item i of values / maxValue into ratio    put ratio * frameHeight into barHeight    drag from round(barLeft),round(barBottom) to     round(barLeft + barWidth),round(barBottom - barHeight)  end repeat  choose browse toolend barChart</pre>