delphi - Getting height of vertiacal bar for specific value -
i'm trying create bar chart stacked series. every bar consists form 2 parts. main part has normal color , black border, "over limit" part has brighter color , red border. there no problem configure behavior in ide (delphi xe3). configured behavior starts bad when have small "over limit" bars. if bar 1px high, red border disappears , 1px brush color line renders. need render border color line. i'm trying change color of bar.
here part of code:
series1.addy((ramtotal-ramavailable-memover) / mb, titlemem); if memover > 0 series2.addy(memover / mb, titlememover); if (memover > 0) , (series2.calcbarbounds(0).height <= 2) series2.valuecolor[0] := fsmallovercolor;
problem calcbarbounds function. returns correct value after chart shown. first time returns 0. results apply border color every "over limit" bar regardless it's height when showing first time. when press reload button clears series , calls same code before, looks fine. doesn't work if call reload code. calling refresh, repaint or whatever doesn't help. trying change color on afterdraw event doesn't work either.
there 1 value every series. have teechart standard v2012.06.120613 32bit.
problem calcbarbounds function. returns correct value after chart shown. first time returns 0. results apply border color every "over limit" bar regardless it's height when showing first time. when press reload button clears series , calls same code before, looks fine. doesn't work if call reload code.
you have force chart repaint before calling calcbarbounds
. internal values aren't initialized or don't have valid values until chart completes first paint.
calling refresh, repaint or whatever doesn't help
have tried calling draw
function?
Comments
Post a Comment