Labels on axes automatically hidden when scrolling

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
PoLabs
Newbie
Newbie
Posts: 13
Joined: Tue Aug 04, 2015 12:00 am

Labels on axes automatically hidden when scrolling

Post by PoLabs » Tue Jul 19, 2016 11:00 am

Hi,

I manually create vertical axes (custom axes) and perfrom axis scroll from code. I noticed that labels on axes become invisible when they approach to IEndPos or IStartPos of axis...
How is this controlled?

I attached image wanted.png to show you what I mean. On the upper part of picture you can see axis whos labels go from 0 to around 70mV... but labels 0mV and 70mV are not visible although I would expect them to be. Similar for the bottom part of the attached image. There are two axes stacked/positioned one above other and both axes has same problem... They don't show min and max labels.

If I grab axis with mouse and move it I can see clearly that this labels gets hidden when I come close to the maximum or minimum of axis. Here is link to youtube where I uploaded video to show you my problem: https://www.youtube.com/watch?v=A23uWgTfyeo

Any idea how should I fix that?

My code for creating axis:

Code: Select all

  Axis := TChartAxisEx.Create(Chart);
  Result := Axis;

  Axis.Automatic := False;
  Axis.AutomaticMaximum := False;
  Axis.AutomaticMinimum := False;

  Axis.Grid.Color := clDefault;
  Axis.Grid.Style := psDot;


  Axis.Horizontal := False;
  Axis.OtherSide := False;

  Axis.LabelsFormat.Font.Name := 'Verdana';
  Axis.LabelsOnAxis := False;
  Axis.LabelsSeparation := 0;

  Axis.AxisValuesFormat :=  '#,##0.000000000';


  DeviceInstance.Engine.LockMethod(procedure begin
    // assign series to axis
    Axis.Series := Series;

    // color

    Axis.Axis.Color := Series.Pen.Color;
    Axis.MinorTicks.Color := Series.Pen.Color;
    Axis.Ticks.Color := Series.Pen.Color;;
    Axis.TicksInner.Color := Series.Pen.Color;;
    Axis.Title.Font.Color := Series.Pen.Color;;
    Axis.Title.Color := Series.Pen.Color;
    Axis.LabelsFormat.Font.Color := Series.Pen.Color;;

    // limits

    Axis.Boundaries.Maximum :=  Series.Channel.State.VoltageDiv;
    Axis.Boundaries.Minimum := -Series.Channel.State.VoltageDiv;

    Axis.SetMinMax(- Series.Channel.State.VoltageDiv, Series.Channel.State.VoltageDiv);
    Axis.Increment := (Axis.Maximum - Axis.Minimum) / VERTICAL_AXIS_DIVS;


    // title

    Axis.Name          := Series.Channel.State.Name;
    Axis.Title.Caption := Axis.Name;

    Axis.Title.Font.Color := Series.Pen.Color;

    // set unit
    Axis.Units := Series.Channel.State.ValueUnit;
  end);


  Axis.PositionUnits := muPixels;
  Axis.Title.Font.Name := 'Verdana';
  Axis.Title.Font.Quality := fqNormal;

  Axis.Visible := true;

  Series.VertAxis := aCustomVertAxis;
  Series.CustomVertAxis := Axis;

  Series.HorizAxis := aCustomHorizAxis;
  Series.CustomHorizAxis := Self.BottomAxis;
Attachments
wanted.png
wanted.png (5.75 KiB) Viewed 7567 times

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

Re: Labels on axes automatically hidden when scrolling

Post by Yeray » Wed Jul 20, 2016 9:53 am

Hello,

The chart may be finding there isn't enough space for the these labels to be drawn.
Have you tried adding some offset to the MinimumOffset&MaximumOffset to the Axis?

If you still find problems with it, please arrange a simple example project we can run as-is to reproduce the problem here.
Thanks in advance.
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

PoLabs
Newbie
Newbie
Posts: 13
Joined: Tue Aug 04, 2015 12:00 am

Re: Labels on axes automatically hidden when scrolling

Post by PoLabs » Wed Jul 20, 2016 10:26 am

This is it. Adding jus 1px to each side helped to solve my issue. I don't know how I wasn't aware of those two properties. :)

Thanks!

Post Reply