Recent

Author Topic: Tchart with dual numbers at the axis  (Read 1215 times)

stephanweber

  • Jr. Member
  • **
  • Posts: 54
Tchart with dual numbers at the axis
« on: April 23, 2024, 09:14:45 am »
Hi,

in my data is is native to have the axis labeled with dual numbers.

E.g. by default your axis label values might be this:

0   50  100  150  250  300

But I want:

0    64   128   192   256

I found that using nice steps can give this. However, it works only at design time, when the real data is inserted at runtime I got back the standard style. I played with extent, range, etc. but at the end I only get the standard setting.

Can anybody help?

Bye Stephan

wp

  • Hero Member
  • *****
  • Posts: 12457
Re: Tchart with dual numbers at the axis
« Reply #1 on: April 23, 2024, 10:48:18 am »
The usual way to display unusual values as axis labels is to put them into an extra TListChartSource which then is assigned to the axis' Marks.Source:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. var
  3.   i: Integer;
  4. begin
  5.   ListChartSource1.Clear;
  6.   for i := 0 to 20 do
  7.     ListChartSource1.Add(i*64, i*64);
  8.   Chart1.BottomAxis.Marks.Source := ListChartSource1;
  9. end;

stephanweber

  • Jr. Member
  • **
  • Posts: 54
Re: Tchart with dual numbers at the axis
« Reply #2 on: May 13, 2024, 02:18:04 pm »
Many thanks! It works fine.

 

TinyPortal © 2005-2018