0

A ColorBand (ChartTool) assigned to Bottom axis on a TChart Component will be compressed when beeing dragged beyond start or end of Bottom axis. ColorBand.StartValue and ColorBand.Endvalue will both take either Start- or Endvalue of Bottom Axis.

Earlier versions of Chart used to preserve the Start- And EndValues of Colorbands, even if the Bands were not visible within the current Bottom axis area.

4
  • Sorry, can you specify what language are you working with?
    – Yeray
    Commented Apr 22 at 11:44
  • Delphi 11.3 (same result with Delphi 10.2) Commented Apr 22 at 11:56
  • TeeChart Pro 2024 VCL - Target Win 32bit Commented Apr 22 at 11:57
  • I see you added it to the bug tracker (#2698). I've now confirmed it happens since TeeChart VCL v2023.38.
    – Yeray
    Commented Apr 30 at 17:38

1 Answer 1

0

As explained at #2698, that change was part of a bug fix and from TeeChart v2023.38 you should set the NoLimitDrag property of the TColorLineTools to True. Ie:

uses Chart, Series, TeeTools;

var Chart1: TChart;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1:=TChart.Create(Self);

  with Chart1 do
  begin
    Parent:=Self;
    Align:=alClient;
    Color:=clWhite;
    Gradient.Visible:=False;
    Walls.Back.Color:=clWhite;
    Walls.Back.Gradient.Visible:=False;
    Legend.Hide;
    View3D:=False;

    with TPointSeries(AddSeries(TPointSeries)) do
    begin
      FillSampleValues(100);
      Pointer.Size:=2;
    end;

    with TColorBandTool(Tools.Add(TColorBandTool)) do
    begin
      Axis:=Axes.Bottom;
      StartValue:=20;
      EndValue:=70;
      StartLine.NoLimitDrag:=True;
      EndLine.NoLimitDrag:=True;
    end;
  end;
end;

Note the NoLimitDrag property of the TColorLineTool(s) inside the TColorBandTool is False by default.
Before v2023.38 setting those NoLimitDrag properties to False/True made no difference, and you could still drag the ColorBand out of the chart without limits.
From TeeChart v2023.38, NoLimitDrag property is considered. As per default, False, those ColorLine values are limited to the bounds of the chart. However, setting the NoLimitDrag property to True does change that behaviour, and you can then drag the ColorBand outside the chart bounds without limits.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.