Page 1 of 1

Bar 3D series not shown when Offset is small

Posted: Mon Aug 22, 2005 4:38 am
by 9333098
When the Offset value in the AddBar method of a Bar3D series is almost equal to the Y Value, the bar is not shown.

series1.AddBar(1, 1, 1);
series1.AddBar(1, 1000, 1000);
series1.AddBar(1, 500, 500);

Then vary the value of Offset for the data at Y=500 using a SpinEdit control and in its ValueChange event do :

series1.delete(2);
series1.AddBar(1, 500, 500+spinedit1.Value);

For a ChartHeight of 530 pixels, I observe no bar being drawn for Offsets of 503 to 506.

I did notice that if the Border is invisible, then no bar is shown for Offsets 500 to 502. The bar begins to appear at 503 which is the value it begins to disappear at if the Border is visible.

Perhaps this is due to round off errrors in calculation of the starting and ending vertical pixel range ?

Steve

Posted: Mon Aug 22, 2005 11:12 am
by narcis
Hi Steve,

It doesn't make sense that you use an offset value being the same as the Y value. If you set Y value to 500 and offset to 500 as well the bar will have a 0 height. Offset values should be lower than bars Y values.

Posted: Mon Aug 22, 2005 1:16 pm
by 9333098
Narcis,

I'm using the Bar3D series to represent a varying range of data values at several X,Y locations. In some situations, the data range is zero, and I want to show a one pixel tall bar when that happens.

But we can ignore that. Add two bars such as
AddBar(1, 10, 9);
AddBar(1, 1000, 990);

Then AddBar(1, 500, 495); This third bar will probably not be shown. Vary the value of the third bar's offset from say 499 to 490.
Also, make the chart's form alignment be alClient and resize the form vertically after adding these bars. The third bar will be shown or not shown depending on the form's height.

This behavior changes somewhat depending on whether the border is visible or not.

Could this behavior be changed so that it always draws at least one pixel tall bar ?

As an aside, I observe that Offset can be larger than the Y value. Marks appear below the bar in such cases.

Steve

Posted: Mon Aug 22, 2005 2:58 pm
by narcis
Hi Steve,
I'm using the Bar3D series to represent a varying range of data values at several X,Y locations. In some situations, the data range is zero, and I want to show a one pixel tall bar when that happens.

But we can ignore that. Add two bars such as
AddBar(1, 10, 9);
AddBar(1, 1000, 990);

Then AddBar(1, 500, 495); This third bar will probably not be shown. Vary the value of the third bar's offset from say 499 to 490.
Also, make the chart's form alignment be alClient and resize the form vertically after adding these bars. The third bar will be shown or not shown depending on the form's height.

This behavior changes somewhat depending on whether the border is visible or not.

Could this behavior be changed so that it always draws at least one pixel tall bar ?
I'm not able to reproduce that behaviour, the third bar is always shown, no matter which is the form's height and if the border is visible or not. Could you please post an example we can run "as-is" to reproduce the problem here? You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.
As an aside, I observe that Offset can be larger than the Y value. Marks appear below the bar in such cases.
Yes, otherwise the marks would overlap the bar as the offset increases in a higher value than bar's Y value.

Posted: Mon Aug 22, 2005 5:55 pm
by 9333098
Ok Narcis, demo project sent which allows the Y Offset and left Y axis maximum to be varied. Also try resizing the form vertically and toggling the bar border visible property.

Steve

Posted: Tue Aug 23, 2005 11:11 am
by narcis
Hi Steve,

Thank you very much for the example project. I've been able to reproduce what you reported resizing the form. I've added this issue to our defect list to be fixed for future releases. There's no workaround I can think of at the present moment.