Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 569

Summary: Zooming in on bar chart does not widen the bars
Product: VCL TeeChart Reporter: h.hasenack <hans>
Component: SeriesAssignee: Steema Issue Manager <issuemanager>
Status: IN_PROGRESS ---    
Severity: normal CC: david, sandra
Priority: Normal    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: Bar Delphi / C++ Builder RAD IDE Version: RAD XE5
Attachments: Unzoomed chart
Zoomed in without the proposed patch
Zoomed in with the patch applied

Description h.hasenack 2014-02-13 02:35:19 EST
Created attachment 85 [details]
Unzoomed chart

When using a barchart, and Autobarwidth is FALSE, and zooming in eg using mouse the data is zoomed in but the bars do not get wider.

(Using the AutoBarsize=TRUE does not do what I require either)

CHeck the attachments for what I mean.

Heres the patch to be applied to TCusomBarSeries.CalcBarWidth

---
    if FAutoBarSize then
       tmp:=Round(IAxisSize/(2.0+Maximum-Minimum))
    else
{$ifdef HH_PATCH_TC_ZOOMBARSIZE}
    begin
       lMax:=ParentChart.MaxXValue(NotMandatoryAxis);
       lMin:=ParentChart.MinXValue(NotMandatoryAxis);
       lZoomFactor:=Maximum-Minimum;
       if lZoomFactor>0.0 then
         lZoomFactor:=(lMax-lMin)/lZoomFactor
       else lZoomFactor:=1.0;

       tmp:=round(IAxisSize*lZoomFactor) div IMaxBarPoints;
    end;
{$else}
      // TV52014436
       tmp:=IAxisSize div IMaxBarPoints;
{$endif}
---
Comment 1 h.hasenack 2014-02-13 02:37:21 EST
Created attachment 86 [details]
Zoomed in without the proposed patch
Comment 2 h.hasenack 2014-02-13 02:37:58 EST
Created attachment 87 [details]
Zoomed in with the patch applied
Comment 3 david berneda 2014-02-18 06:27:34 EST
Thanks for the patch.
Can you attach a example project?

The proposal looks fine for this specific case, but it will break other combinations of series, or multiple bar series that are "side-stacked", or with Horizontal Bar series, etc.

I'll try to improve this calculation when AutoBarSize=True.
Comment 4 h.hasenack 2014-02-19 03:12:47 EST
You can use the teechart office or teehcart demo app to reproduce. 
Just pick a bar chart and zoom-in. Zoom works, but bars are not widened accordingly.