After Layout

The AfterLayout event occurs after the chart in the PivotChart view has been laid out but before the chart elements have been drawn on screen. Use this event to draw custom lines, text, and various drawings on the chart.

The drawObject parameter in the AfterLayout event represents a chChartDraw object. The DrawEllipse, DrawLine, DrawPolyLine, and DrawPolygon methods of the chChartDraw object can be used to add drawing objects to a chart. The DrawText method can be used to add text to a chart. The Border, Font, Interior, and Line properties can be used to format each drawing object before it is added to the chart.

The AfterLayout event can also be used to reposition the chTitle, chLegend, chChart, and chAxis objects of each PivotChart view by changing their Left and Top properties. You can reposition the chPlotArea object by changing its Left, Top, Right, and Bottom properties.

Part IV

The event procedure in Hands-On 24-23 changes the chart legend and its accompanying label's position on the screen.

0 0

Post a comment