Page 1 of 1

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

Posted: Wed Jan 27, 2016 4:11 am
by 16576306
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

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

Posted: Wed Jan 27, 2016 2:03 pm
by yeray
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.

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

Posted: Thu Jan 28, 2016 12:46 am
by 16576306
When assigning a BackImage or Gradient, how to make THE CIRCLE AREA transparent or not?

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

Posted: Thu Jan 28, 2016 9:21 am
by yeray
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.

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

Posted: Fri Jan 29, 2016 5:43 am
by 16576306
“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

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

Posted: Fri Jan 29, 2016 12:01 pm
by yeray
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;

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

Posted: Sat Jan 30, 2016 4:36 am
by 16576306
Yes, it works to load a Picture. But, how to change the Gradient of THE CIRCLE AREA? Thanks.

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

Posted: Mon Feb 01, 2016 8:57 am
by yeray
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;
//...