The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



OnDataRendered


Unit:SDL_boxplot
Class: TBoxPlot
Declaration: OnDataRendered: TRenderEvent;
{ TRenderEvent = procedure (Sender: TObject; canvas: TCanvas; Top, Left: integer) of object; }

The events OnBeforeRenderData, OnDataRendered and OnScalesRendered  provide hooks for adding user defined graphics to an boxplot. Internally, a boxplot is constructed in three phases before the result is copied to the screen: in the first phase the scales are drawn, then the boxes are drawn and finally the crosshairs are rendered. The OnScalesRendered event is triggered after the scales are drawn giving access to the non-data areas of TBoxPlot (i.e. the areas where the scales and captions are drawn). The events OnBeforeRenderData and OnDataRendered are triggered before and after drawing the diagram.

The event OnDataRendered occurs after the boxplot diagram has been drawn and before the crosshairs are inserted and the chart is copied to the screen. The variable parameter Canvas provides access to the canvas of the data area. Please note that the state of the canvas (e.g. the color of its pen, or the fill mode of the brush) depends on the graphics elements drawn before. The parameters Top and Left contain the offset of the data area relative to the entire chart area.

Hint 1: The declaration of this event has been changed with the introduction of release 10.1 of the SDL Suite. Please see the corresponding type declaration and the section How to Deal with a Canvas Reference Change for details.

Hint 2: In order to avoid unwanted size effects regarding characters displayed on canvases of different resolution (i.e. the screen and a printer) you should never directly assign the font size within the event. Use SetCanvasFontSizeScaled instead. So, for example, the statement Canvas.Font.Size := 12; should be replaced by SetCanvasFontSizeScaled (Canvas, 12);



Last Update: 2023-Dec-13