Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 951 - White space between the slices in concentric Pie/Donut
Summary: White space between the slices in concentric Pie/Donut
Status: IN_PROGRESS
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Series (show other bugs)
Version: 140923
Hardware: Other Other
: --- minor
Target Milestone: ---
Assignee: Steema Issue Manager
URL: http://www.teechart.net/support/viewt...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-08 07:58 EDT by yeray alonso
Modified: 2015-04-23 06:58 EDT (History)
1 user (show)

See Also:
Chart Series: Pie
Delphi / C++ Builder RAD IDE Version: Delphi 7


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yeray alonso 2014-10-08 07:58:27 EDT
Having  Concentric TPieSeries/TDonutSeries without Pen, there's a little white 
space drawn between the slices

uses Series, TeeDonut;

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

  for i:=0 to 9 do
    //with Chart1.AddSeries(TPieSeries) as TPieSeries do
    with Chart1.AddSeries(TDonutSeries) as TDonutSeries do
    begin
      MultiPie:=mpConcentric;
      Marks.Visible:=false;
      Pen.Visible:=false;

      for j:=0 to 9 do
        Add(10,'',clBlack);
    end;
end;
Comment 1 david berneda 2014-10-10 06:08:34 EDT
Problem due to canvas antialias. Same issue happens with Firemonkey.

A possible workaround is to fill the circle behind the series:

...
  Chart1.Draw;
end;

procedure TForm1.Chart1BeforeDrawSeries(Sender: TObject);
var p : TPieSeries;
begin
  p:=TPieSeries(Chart1[0]);

  Chart1.Canvas.Brush.Style:=bsSolid;
  Chart1.Canvas.Brush.Color:=clBlack;

  Chart1.Canvas.Ellipse(p.CircleRect);
end;

Another solution is to set the series Pen color to be the same color as the series data color.  The pen antialias will cover the missing pixels.
Comment 2 yeray alonso 2015-04-23 06:58:51 EDT
Both workarounds would work when all the series and all the values have the same color, but not when having different colors. Ie:

uses Series;

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

  for i:=0 to 3 do
    with Chart1.AddSeries(TPieSeries) as TPieSeries do
    begin
      MultiPie:=mpConcentric;
      Marks.Visible:=false;
      Pen.Visible:=false;
      for j:=0 to 9 do
          Add(10,'',clNone);
    end;

  Chart1[0].ValueColor[0]:=OperaPalette[0];
  Chart1[1].ValueColor[0]:=OperaPalette[0];

  Chart1[0].ValueColor[2]:=OperaPalette[1];
  Chart1[1].ValueColor[2]:=OperaPalette[1];
  Chart1[2].ValueColor[2]:=OperaPalette[1];

  Chart1[0].ValueColor[3]:=OperaPalette[2];
  Chart1[1].ValueColor[3]:=OperaPalette[2];
  Chart1[2].ValueColor[3]:=OperaPalette[2];
  Chart1[3].ValueColor[3]:=OperaPalette[2];

  Chart1[0].ValueColor[5]:=OperaPalette[3];
  Chart1[1].ValueColor[5]:=OperaPalette[3];

  Chart1[0].ValueColor[7]:=OperaPalette[4];
  Chart1[1].ValueColor[7]:=OperaPalette[4];
  Chart1[2].ValueColor[7]:=OperaPalette[4];

  Chart1[0].ValueColor[8]:=OperaPalette[5];
  Chart1[1].ValueColor[8]:=OperaPalette[5];
end;