I have a DBChart
with four PieSeries
on it. Each chart has multiple slices, and is multicolored. I'd like to have the title of each series written either on it or beneath it, instead of the legend. Is there any easy way to accomplish this? I'm using TeeChart Standard v2011.03.32815 VCL
0
votes
Seems there is no easy way for that in TChart. My suggestion would be to have 4 TDBCharts nicley alligned with only one PieSeries in each.
- iamjoosy
The official support people for TeeChart monitor this site, and may have a better answer, but I don't know how to do it.
- Warren P
1 Answers
1
votes
The Pro version includes the Annotation tool that would be useful here.
With the Standard version, you could just have 4 TDBCharts as mentioned in a comment above, or you could also draw manually your texts on the canvas. Ie:
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
for i:=0 to 3 do
with Chart1.AddSeries(TPieSeries) as TPieSeries do
begin
FillSampleValues;
end;
end;
procedure TForm1.Chart1AfterDraw(Sender: TObject);
var i, tmpX, tmpY: Integer;
tmpStr1, tmpStr2: string;
begin
tmpStr1:='My Pie nÂș';
for i:=0 to Chart1.SeriesCount-1 do
begin
tmpStr2:=tmpStr1+IntToStr(i+1);
with (Chart1[i] as TPieSeries), Chart1.Canvas do
begin
tmpX:=CircleXCenter-(TextWidth(tmpStr2) div 2);
if (i<2) then
tmpY:=CircleRect.Top-20
else
tmpY:=CircleRect.Bottom+10;
TextOut(tmpX, tmpY, tmpStr2);
end;
end;
end;