Get error when trying to set Series17.MultiArea:= maNone

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
redgar
Newbie
Newbie
Posts: 14
Joined: Tue Jan 15, 2013 12:00 am

Get error when trying to set Series17.MultiArea:= maNone

Post by redgar » Wed Feb 13, 2013 1:22 pm

I have created a chart that shows 2 series as Horizontal Areas, and have placed a checkbox on the form to allow the user to selected whether the 2 series be stacked or not; both series are in the same stackgroup. See code below;

procedure TMainForm.CBoxBacklogClick(Sender: TObject);
begin
if MainForm.CBoxBacklog.Checked then Series17.MultiArea:= maStacked
else Series17.MultiArea:= maNone;
end;

Sadly when I attempt to compile this code I get the error

[dcc32 Error] Main.pas(345): E2010 Incompatible types: 'TMultiArea' and 'TMenuAnimations'

for the line else Series17.MultiArea:= maNone;

The compiler happily accepts maStacked so why does it fail on maNone?

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

Re: Get error when trying to set Series17.MultiArea:= maNone

Post by Yeray » Wed Feb 13, 2013 2:34 pm

Hi,

It seems there's another type (TMenuAnimations) declaring an enumeration with the same name maNone, and the IDE is taking the first one instead of the second, causing this error.
You can force the second to be used instead of the first by using TMultiArea(maNone) isntead of just maNone.
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

redgar
Newbie
Newbie
Posts: 14
Joined: Tue Jan 15, 2013 12:00 am

Re: Get error when trying to set Series17.MultiArea:= maNone

Post by redgar » Wed Feb 13, 2013 2:55 pm

Hi Yeray

Thanks for that; the code now compiles; however, though the series can be stacked, they do not "un stack" when MultiArea is set to TMultiarea(maNone).

I have also called Refresh for the DBChart but without any success.

Please advise.

Many thanks

Rob

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

Re: Get error when trying to set Series17.MultiArea:= maNone

Post by Yeray » Wed Feb 13, 2013 4:22 pm

Hi Rob,

This seems to work fine for me here in a simple application with just a chart on the form:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  for i:=0 to 2 do
  with Chart1.AddSeries(TAreaSeries) as TAreaSeries do
  begin
    FillSampleValues;
    MultiArea:=maStacked;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  (Chart1[0] as TAreaSeries).MultiArea:=TMultiArea(maNone);
end;
Does the above simple example work fine for you?
Please, try to 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

Post Reply