How To Draw Polygon/Rectangle In TChart

2019-09-12 09:35发布

问题:

I just need a little push. I have a chart with a series as a tpointseries. I am having difficultly in figuring out how to draw the series as a polygon/rectangle.

When I mean polygon or rectangular, you have 4 corners (bottom_left X/Y, top_left X/Y, top_right X/Y and bottom_right XY) which create 4 lines and fill the area between those 4 corners.

Thanks in advanced.

回答1:

1) Create series of TChartShape type with rectangle style and add shape with needed coordinates

2) Draw rectangle on chart canvas in OnAfterDraw event handler