Hello, I have both Pro 7.08 (in Delphi 2006) and Standard 2010.01.20814 (in Delphi XE). I am looking to get a white interior (the area within the axes) and transparent outside of this to the edges of the chart. The white interior is fine (BackWall.Color=clWhite and Transparent=False) but I don't see any option for the outer transparency. I've tried Chart.Color=clNone but this just results in white.
(Note: I am trying to duplicate the appearance of an Excel chart. This is done quite easily with ChartArea.Fill=NoFill and PlotArea.Fill=Solid.)
Is this possible? Do I need to get the current version (2012)?
TIA, Jim
Chart transparency
Re: Chart transparency
Hello Jim,
I have made a simple code that I can help to achieve as you want:
Can you tell us if next code works as you expecte?
Thanks,
I have made a simple code that I can help to achieve as you want:
Code: Select all
Uses Series;
procedure TForm3.FormCreate(Sender: TObject);
var Series1:TLineSeries;
begin
Chart1.Walls.Left.Visible := false;
Chart1.Walls.Bottom.Visible:=false;
Chart1.Walls.Back.Color:= clWhite;
Chart1.Walls.Back.Visible:=false;
Chart1.Gradient.Visible:=false;
Chart1.Color := clWhite;
Series1 := TLineSeries.Create(self);
Chart1.AddSeries(Series1);
end;
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Chart transparency
Sandra, thanks for the reply. Sorry, no, this produces a completely white chart (using Standard 2010.01.20814) I don't see anything in the code below that indicates transparency for the outer area. (I DO see a Transparent property for the BackWall that does let the Chart1.Color show through.) Note that I'm only doing a 2D chart, so the walls other than Back are N/A.
Surely there must be a way to do this. Like "Chart1.Transparent := True;"? Or "Chart1.ParentBackground := True;"? (like TPanel)
Jim
Surely there must be a way to do this. Like "Chart1.Transparent := True;"? Or "Chart1.ParentBackground := True;"? (like TPanel)
Jim
Re: Chart transparency
Hello Jim,
Ok. I suggest you taking a look in this thread where Narcís explains as you achieve the panel to be transparent.
Thanks,
Ok. I suggest you taking a look in this thread where Narcís explains as you achieve the panel to be transparent.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Chart transparency
The link you gave is to a thread title "Anchors not published" (?)
However, if you're referring to this:
if not Assigned(Back) then
begin
Back:=TBitmap.Create;
Back.Width:=Chart1.Width;
Back.Height:=Chart1.Height;
Back.Canvas.CopyRect(Chart1.ClientRect,Canvas,Chart1.BoundsRect);
end;
if Chart1.Color=clNone then
Chart1.Canvas.Draw(0,0,Back);
Then yes, it does work (with alterations for when the parent is a TPanel, not a Form).
Still, I'm very surprised this is not a built-in option!
However, if you're referring to this:
if not Assigned(Back) then
begin
Back:=TBitmap.Create;
Back.Width:=Chart1.Width;
Back.Height:=Chart1.Height;
Back.Canvas.CopyRect(Chart1.ClientRect,Canvas,Chart1.BoundsRect);
end;
if Chart1.Color=clNone then
Chart1.Canvas.Draw(0,0,Back);
Then yes, it does work (with alterations for when the parent is a TPanel, not a Form).
Still, I'm very surprised this is not a built-in option!
Re: Chart transparency
Hello Jim,
Sorry I have been wrong with link. The correct thread is this.
Thanks,
Sorry I have been wrong with link. The correct thread is this.
if you take a look in the link you will find the problem is caused for the panel as explained NarcísStill, I'm very surprised this is not a built-in option!
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |