我有一个TAreaSeries
充满这样的数据:
我正在使用此代码在图表上绘制垂直线:
procedure TfrmDistributionChart.dbcDistributionAfterDraw(Sender: TObject);
var
XPos: Integer;
begin
dbcDistribution.Canvas.Pen.Width := 3;
dbcDistribution.Canvas.Pen.Color := clBlack;
XPos := dbcDistribution.BottomAxis.CalcPosValue(0);
dbcDistribution.Canvas.DoVertLine(XPos, dbcDistribution.LeftAxis.IStartPos,
dbcDistribution.LeftAxis.IEndPos);
dbcDistribution.Canvas.Pen.Color := clBlue;
XPos := dbcDistribution.BottomAxis.CalcPosValue(-SD);
dbcDistribution.Canvas.DoVertLine(XPos, dbcDistribution.LeftAxis.IStartPos,
dbcDistribution.LeftAxis.IEndPos);
XPos := dbcDistribution.BottomAxis.CalcPosValue(SD);
dbcDistribution.Canvas.DoVertLine(XPos, dbcDistribution.LeftAxis.IStartPos,
dbcDistribution.LeftAxis.IEndPos);
dbcDistribution.Canvas.Pen.Color := clGreen;
XPos := dbcDistribution.BottomAxis.CalcPosValue(-2 * SD);
dbcDistribution.Canvas.DoVertLine(XPos, dbcDistribution.LeftAxis.IStartPos,
dbcDistribution.LeftAxis.IEndPos);
XPos := dbcDistribution.BottomAxis.CalcPosValue(2 * SD);
dbcDistribution.Canvas.DoVertLine(XPos, dbcDistribution.LeftAxis.IStartPos,
dbcDistribution.LeftAxis.IEndPos);
dbcDistribution.Canvas.Pen.Color := clRed;
XPos := dbcDistribution.BottomAxis.CalcPosValue(-3 * SD);
dbcDistribution.Canvas.DoVertLine(XPos, dbcDistribution.LeftAxis.IStartPos,
dbcDistribution.LeftAxis.IEndPos);
XPos := dbcDistribution.BottomAxis.CalcPosValue(3 * SD);
dbcDistribution.Canvas.DoVertLine(XPos, dbcDistribution.LeftAxis.IStartPos,
dbcDistribution.LeftAxis.IEndPos);
end;
我想更改系列的颜色以匹配其外边框的颜色(例如,中央切片为蓝色,中间切片为绿色,最外层为红色)。TeeChart Standard v2011.03.32815 32bit VCL 可以做到这一点吗?
此外,我找不到修剪垂直线的正确方法,以避免超出它们所绘制的区域。我应该如何计算这 7 条线中每条线的正确高度?