Horizontal Bar series problem with bar Width after zooming
Posted: Wed Aug 31, 2005 2:13 pm
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.
Add 50 data values to a horizontal bar series. In a SpinEdit control (whose Increment is set to say 10) OnChange event, set series1.BarWidthPercent := spinedit1.Value; As this bar width percent is changed, the bar width will track correctly. If the chart is zoomed vertically to show say 25% of its height, then changes to its bar width percent show incorrectly. It appears that the bar widths are being calculated based on the unzoomed width parameters. The bar widths after zooming are similar in actual pixels to before zooming.
When the bar width percent is set to 100, the top of the bar does not move but the bar bottom is drawn down to the next lower data value's bar top. This makes it appear that the bar center is lower than its actual vertical axis value. For cases where all data values have the same Y increment, this can be corrected for by setting
series1.CustomBarHeight := series1.CalcYPos(0)-series1.CalcYPos(1);
Add 50 data values to a horizontal bar series. In a SpinEdit control (whose Increment is set to say 10) OnChange event, set series1.BarWidthPercent := spinedit1.Value; As this bar width percent is changed, the bar width will track correctly. If the chart is zoomed vertically to show say 25% of its height, then changes to its bar width percent show incorrectly. It appears that the bar widths are being calculated based on the unzoomed width parameters. The bar widths after zooming are similar in actual pixels to before zooming.
When the bar width percent is set to 100, the top of the bar does not move but the bar bottom is drawn down to the next lower data value's bar top. This makes it appear that the bar center is lower than its actual vertical axis value. For cases where all data values have the same Y increment, this can be corrected for by setting
series1.CustomBarHeight := series1.CalcYPos(0)-series1.CalcYPos(1);