Hi,
I have 2 questions:
When I look at a chart in the Delphi development environment, the chart works as it should but when I create even a very simple project - it doesn't. The first and last bars appearing on the chart are both half off the chart - why is this? Am I doing something wrong here?
Also the bar widths - in the development environment, the sample bars expand and contract as they should when I adjust the Series | Format | % Bar Offset - but when I run the program, the behavior is very different.
I enclose a sample project illustrating these questions.
Thank you.
Bars half off chart & bar widths
Bars half off chart & bar widths
- Attachments
-
- TeeChartBarTest.zip
- (3.55 KiB) Downloaded 554 times
Re: Bars half off chart & bar widths
Hello,
Try forcing a chart repaint and assigning a MinimumOffset and a MaximumOffset relative to the series' BarWidth:
When you call SetMinMax you are forcing the axis minimum and maximum, but this doesn't take in consideration if the series being drawn need extra space to fit.MVBobj wrote:When I look at a chart in the Delphi development environment, the chart works as it should but when I create even a very simple project - it doesn't. The first and last bars appearing on the chart are both half off the chart - why is this? Am I doing something wrong here?
Try forcing a chart repaint and assigning a MinimumOffset and a MaximumOffset relative to the series' BarWidth:
Code: Select all
DBChart1.BottomAxis.SetMinMax(0, StrToInt(Edit1.Text));
DBChart1.Draw;
DBChart1.BottomAxis.MinimumOffset:=Series1.BarWidth div 2;
DBChart1.BottomAxis.MaximumOffset:=Series1.BarWidth div 2;
Try setting AutoBarSize to true:MVBobj wrote:Also the bar widths - in the development environment, the sample bars expand and contract as they should when I adjust the Series | Format | % Bar Offset - but when I run the program, the behavior is very different.
Code: Select all
Series1.AutoBarSize:=true;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |