HorizBar CustomBarHeight behavior changed from 7.06 to 7.07
Posted: Wed Jul 26, 2006 5:16 pm
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
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