Page 1 of 1

Wrong X Axis displayed when legend has checkboxes

Posted: Sun Jan 08, 2012 7:41 pm
by 16859007
Hi,

I have a strange issue:

I have a chart with 2 series, and the legend has checkboxes.

When I display the chart with the normal stuff - the X-Axis is just fine.

If I uncheck both series, and then check again one of the series - the X-Axis loses it's normal formatting and shows the internal data-value of the X-Axis instead of my pre-defined x-axis values.

Any ideas?

Re: Wrong X Axis displayed when legend has checkboxes

Posted: Mon Jan 09, 2012 2:37 pm
by yeray
Hi,

I'm trying to reproduce the problem with the following code but it shows the same labels in the bottom axis all the time:

Code: Select all

uses Series;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.Legend.CheckBoxes:=true;

  Chart1.AddSeries(TPointSeries).FillSampleValues();
  Chart1.AddSeries(TPointSeries).FillSampleValues();

  with Chart1.Axes.Bottom.Items do
  begin
    Clear;
    Add(0, '0');
    Add(2, '2');
    Add(5, '5');
    Add(8, '8');
    Add(9, '9');
    Add(15, '15');
    Add(19, '19');
    Add(24, '24');
  end;
end;
rloewy wrote:instead of my pre-defined x-axis values
The clue will probably be on how are you defining these labels.

If you still have problems with it, please, try to arrange a simple example project we can run as-is to reproduce the problem here.
Thanks in advance.