Using a Color Band to select a range of bars

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
TestAlways
Advanced
Posts: 228
Joined: Tue Aug 28, 2007 12:00 am
Location: Oregon, USA

Using a Color Band to select a range of bars

Post by TestAlways » Fri Apr 25, 2014 7:20 pm

In the demo using the link, I can click and drag the mouse left or right and it will normally highlight a x-range of the grid -- a color band highlights the selected items.

1. But.... sometimes it doesn't work (this it is highlighted in the MP4 video in the download). I can click and drag and the color band's start and end value seem to be the same. It seems that this occurs if I click on the very left side of a bar.

http://www.TBInc.com/misc/SelectionPoint3a.zip

I can't figure out how to fix this behavior.

2. Also, when the band is drawn, it is drawn from the left edge of the bar. How can I make the band start in the middle of the bar?

Thank you,

Ed Dressel

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Using a Color Band to select a range of bars

Post by Yeray » Mon Apr 28, 2014 10:44 am

Hi Ed,
TestAlways wrote:1. But.... sometimes it doesn't work (this it is highlighted in the MP4 video in the download). I can click and drag and the color band's start and end value seem to be the same. It seems that this occurs if I click on the very left side of a bar.

http://www.TBInc.com/misc/SelectionPoint3a.zip

I can't figure out how to fix this behavior.
This part is the easy one. Some events seem to be interfering here. You can fix it disabling the AllowDrag property on all the dependant tools:

Code: Select all

  cbHighlight.StartLine.AllowDrag:=false;
  cbHighlight.EndLine.AllowDrag:=false;
  cbHighlight.AllowDrag:=false;
TestAlways wrote:2. Also, when the band is drawn, it is drawn from the left edge of the bar. How can I make the band start in the middle of the bar?
This will be more difficult. This means to change how the TColorBandTool is being drawn and I haven't found a way to override the needed functions so I can only think on modifying the TColorBandTool Drawing method on TeeChart sources or to skip using this tool and draw what you want in the OnBeforeDrawSeries event.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply