*! version 1.0.0 30jul2002 version 8 class { } , inherit(bargraph_g) program draw_bar args x y size id // if horiz is really y x if `.horizontal.istrue' { local trans = `gdi(xbeta)' / `gdi(ybeta)' } else local trans = `gdi(ybeta)' / `gdi(xbeta)' local width_b = min(.9*`size'*`trans', `.barsize') local x = `x' + `.barsize' / 2 local top = `y' + `size' if `.horizontal.istrue' { local sz_b = `width_b' * `gdi(ybeta)' / `gdi(gbeta)' } else local sz_b = `width_b' * `gdi(xbeta)' / `gdi(gbeta)' // the bal gdi symbol = circle gdi gm_symbolsize = `sz_b' if `.horizontal.istrue' { gdi point `=`top'-(`width_b'/2)/`trans'' `x' } else gdi point `x' `=`top'-(`width_b'/2)/`trans'' gdi gm_symbolsize = `=`sz_b'/6' local top = `top'-(`width_b'+.3)/`trans' if `.horizontal.istrue' { gdi symbol = square gdi point `top' `x' } else { gdi symbol = triangle gdi point `x' `top' } // the str local xdeltas -4 -26 -19 -2 5 25 35 20 12 3 -5 -19 -22 -4 local yd = (`top'-`y') / `:word count `xdeltas'' local y = `top' foreach xp of local xdeltas { local x1 = `x' + `xp'*`.barsize'/100 local y1 = `y' - `yd' if `.horizontal.istrue' { gdi line `y' `x' `y1' `x1' } else gdi line `x' `y' `x1' `y1' local x `x1' local y `y1' } end