ITChart.ChartRect
ITChart

procedure ChartRect(Left, Top, Right, Bottom: Integer);

Type Library
TeeChartx

Description
The ChartRect function sets the Axis bounding rectangle adding the 3D percent offset in pixels to the Right and Top coordinates. It should be used before painting the Chart component to which you wish it to apply.

The bounding rectangle can be obtained via Axis Positions:

TChart.Axis.Left.Position,

TChart.Axis.Top.Position - TChart.Aspect.Height3D,

TChart.Axis.Right.Position + TChart.Aspect.Width3D,

TChart.Axis.Bottom.Position

Example [Visual Basic]:

'Draws 4 Pies on a Chart

Private Sub Form_Load()

With TChart1

.Aspect.View3D = False

.Legend.Visible = False

.Aspect.ApplyZOrder = False

'Pie 0

.AddSeries scPie

.Series(0).FillSampleValues 3

'Pie 1

.AddSeries scPie

.Series(1).FillSampleValues 7

'Pie 2

.AddSeries scPie

.Series(2).FillSampleValues 5

'Pie 3

.AddSeries scPie

.Series(0).FillSampleValues 6

End With

End Sub

Private Sub TChart1_OnSeriesBeforeDrawValues(ByVal SeriesIndex As Long)

With TChart1

Select Case SeriesIndex

Case 0: .ChartRect 0, 0, _

.Canvas.Width/2, .Canvas.Height/2

Case 1: .ChartRect .Canvas.Width/2, 0, _

.Canvas.Width, .Canvas.Height/2

Case 2: .ChartRect 0, .Canvas.Height/2, _

.Canvas.Width/2, .Canvas.Height

Case 3: .ChartRect .Canvas.Width/2, .Canvas.Height/2, _

.Canvas.Width, .Canvas.Height

End Select

End With

End Sub