|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....|
|Home ChartPack RChart Class TRChart Events OnBeforeRenderData|
|See also: TRenderEvent, OnScalesRendered, OnScaleTickDrawn, OnDataRendered, TBeforeRenderCellEvent, SetCanvasFontSizeScaled, OnBeforeRenderChartItem, TBeforeRenderCItemEvent|
The events OnBeforeRenderData, OnDataRendered and OnScalesRendered provide hooks for adding user defined graphics to an RChart. Internally, a chart is constructed in three phases before the result is copied to the screen: in the first phase the scales are drawn, then the data is 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 TRChart (i.e. the areas where the scales and captions are drawn). The events OnBeforeRenderData and OnDataRendered are triggered before and after drawing the chart. Note that the latter two events give access to the chart canvas (the area where the chart elements are is drawn).
The event OnBeforeRenderData occurs immediately before the chart is drawn. The variable parameter Canvas provides access to the canvas of the data area. The parameters Top and Left contain the offset of the data area relative to the entire chart area. You need these two values if you want to position your own drawing elements relative to the real-world coordinate system (by using the method R2M).