How to fill the circle area with a picture for TPolarChart?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
sripe
Newbie
Newbie
Posts: 26
Joined: Thu Sep 10, 2015 12:00 am

How to fill the circle area with a picture for TPolarChart?

Post by sripe » Wed Jan 27, 2016 4:11 am

The following codes are OK for TLineChart, but they do not work for TPolarChart.
if OpenDialog1.Execute then
begin
TheChart.BackImageInside := True;
TheChart.BackImage.LoadFromFile(OpenDialog1.FileName);
end;

For TPolarChart , how to fill THE CIRCLE AREA with a picture?
Best Regards

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

Re: How to fill the circle area with a picture for TPolarChart?

Post by Yeray » Wed Jan 27, 2016 2:03 pm

Hello,

I've filed the issue to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1417

As you'll see I've also found a workaround for it and I've also fixed it for the next maintenance release.
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

sripe
Newbie
Newbie
Posts: 26
Joined: Thu Sep 10, 2015 12:00 am

Re: How to fill the circle area with a picture for TPolarChart?

Post by sripe » Thu Jan 28, 2016 12:46 am

When assigning a BackImage or Gradient, how to make THE CIRCLE AREA transparent or not?
Attachments
xxxxx.jpg
xxxxx.jpg (330.91 KiB) Viewed 10140 times

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

Re: How to fill the circle area with a picture for TPolarChart?

Post by Yeray » Thu Jan 28, 2016 9:21 am

Hello,

This seems to work fine for me:

Code: Select all

uses TeePolar;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.View3D:=false;
  Chart1.Legend.Visible:=false;
  Chart1.Title.Visible:=false;

  Chart1.Gradient.StartColor:=RGB(240, 125, 20);
  Chart1.Gradient.MidColor:=RGB(150, 10, 240);
  Chart1.Gradient.EndColor:=RGB(200, 183, 225);

  for i:=0 to 1 do
    with Chart1.AddSeries(TPolarSeries) as TPolarSeries do
    begin
      FillSampleValues;
      Pointer.Visible:=false;
      Brush.Clear;
      Pen.Color:=Color;
      Pen.Width:=2;
      CircleBrush.Clear;
    end;
end;
Don't hesitate to let us know if you still find problems with it.
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

sripe
Newbie
Newbie
Posts: 26
Joined: Thu Sep 10, 2015 12:00 am

Re: How to fill the circle area with a picture for TPolarChart?

Post by sripe » Fri Jan 29, 2016 5:43 am

“Fill” is to fill Gradient or Picture.
“Inside” is to fill Gradient or Picture in THE CIRCLE AREA, Otherwise to fill THE CHART PANEL.

When “Inside” checked, it does not work as I expected. Would you like to test and correct it for me?
Best regards
Attachments
Example.zip
(58.84 KiB) Downloaded 560 times

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

Re: How to fill the circle area with a picture for TPolarChart?

Post by Yeray » Fri Jan 29, 2016 12:01 pm

Hello,
sripe wrote:When “Inside” checked, it does not work as I expected. Would you like to test and correct it for me?
I'm sorry, the workaround wasn't correct. The good one is to clear CircleBrush. Ie, in your test application:

Code: Select all

procedure TForm1.BitBtn2Click(Sender: TObject);
begin
  if OpenDialog1.Execute then
    begin
      Chart1.BackImageInside := CheckBox8.Checked;

      (ChartListBox1.SelectedSeries as TPolarSeries).CircleBrush.Clear;
      Chart1.BackImage.LoadFromFile(OpenDialog1.FileName);
    end;
end;
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

sripe
Newbie
Newbie
Posts: 26
Joined: Thu Sep 10, 2015 12:00 am

Re: How to fill the circle area with a picture for TPolarChart?

Post by sripe » Sat Jan 30, 2016 4:36 am

Yes, it works to load a Picture. But, how to change the Gradient of THE CIRCLE AREA? Thanks.

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

Re: How to fill the circle area with a picture for TPolarChart?

Post by Yeray » Mon Feb 01, 2016 8:57 am

Hello,

In your FormCreate, after clearing the CircleBrush, try assigning it a bsSolid TBrushStyle:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
//...
              CircleBrush.Clear;
              CircleBrush.Style:=bsSolid;
//...
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