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?
Get error when trying to set Series17.MultiArea:= maNone
Re: Get error when trying to set Series17.MultiArea:= maNone
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.
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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Get error when trying to set Series17.MultiArea:= maNone
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
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
Re: Get error when trying to set Series17.MultiArea:= maNone
Hi Rob,
This seems to work fine for me here in a simple application with just a chart on the form:
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.
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;
Please, try to arrange a simple example project we can run as-is to reproduce the problem here.
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |