Page 1 of 1

HorizBar CustomBarHeight behavior changed from 7.06 to 7.07

Posted: Wed Jul 26, 2006 5:16 pm
by 9333098
The behavior of Horizontal Bar series CustomBarHeight has changed from version 7.06 to 7.07. I am using small values of CustomBarHeight to create many thin horizontal lines that can be located at any vertical data value and whose horizontal width can be varied. By varying the value of CustomBarHeight the thickness of the individual lines can be changed.

For TChart 7.06 the actual number of pixels plotted on the HorizBar series is CustomBarHeight + 1 :
CustomBarHeight=0 shows 1 pixel (if BarWidthPercent := 0)
CustomBarHeight=1 shows 2 pixels with data value at the upper pixel,
CustomBarHeight=2 shows 3 pixels with data value at center pixel,
CustomBarHeight=3 shows 4 pixels with data value at pixel below center,
i.e. the data value (and a cursor tool linked to it) is centered within the bar.

For TChart 7.07 :
CustomBarHeight := 0 shows as 1 pixel with cursor centered within bar,
CustomBarHeight := 1 shows no bar,
CustomBarHeight := 2 shows as 1 pixel but with bar above cursor
CustomBarHeight := 3 shows as 2 pixels but with bar above cursor
CustomBarHeight := 4 shows as 3 pixels but with bar above cursor

I am using a horizontal cursor tool and customers are complaining that with 7.07 the cursor location appears below the actual bar position, i.e. the cursor is not centered within the thicker bar line.

This can be shown using this code for a 2D HorizBar series :

series1.BarPen.Visible := false;
series1.BarWidthPercent := 0;
series1.CustomBarHeight := 0;

series1.FillSampleValues(5);

Then use a spinedit control's OnChange event :
series1.CustomBarHeight := spinedit1.Value;

With 7.07 the bar (for 2 or 3 pixel thick bars) is drawn slightly above the actual vertical axis data value.

This behavior is no doubt not a typical usage of this series and thus perhaps considered trivial but I am wondering if this change crept in as an unintended consequence of some other change and therefore could be changed back.

Thanks,

Steve

Posted: Thu Jul 27, 2006 12:55 pm
by narcis
Hi Steve,

I could reproduce the issue here. Some changes were applied to solve other problems with BarWidthPercent when it was set to 100%. I will add your request to our bug list to be reviewed again.

Posted: Thu Jul 27, 2006 1:37 pm
by 9333098
Narcis,

Did these changes happen to address the issue of "Horizontal Bar series does not show the correct bar width after zooming vertically. If BarWidthPercent is 100, the horizontal center of the bar position appears lower on the vertical axis than it should be."

http://www.teechart.net/support/viewtop ... ight=#9773

Steve

Posted: Mon Jul 31, 2006 10:27 am
by Pep
Hi Steve,

the changes has been applied specially in order to fix some problems with Bar or HorizBar with BarWidthPercent to 100, with stack, and also having changed the pointsperpage.