Hide Comments
Hide Comments

Comments (0)

Extends the FMX.RS.ChartPanel.TRSChartLabelMetaData class to provide the ability to draw the legend of a chart panel. It also adds properties for the legend, including  BoxSize, Lines , and LegendStyle .
 

Namespace: FMX.RS.ChartPanel

expandingInheritance Hierarchy

TInterfacedPersistent
  FMX.RS.ChartPanel.TRSChartGraphic
    FMX.RS.ChartPanel.TRSCustomChartLabel
      FMX.RS.ChartPanel.TRSChartLabelMetaData
        FMX.RS.ChartPanel.TRSChartLegend
          FMX.RS.ChartLegends.TRSChartLegendHack
 

expandingSyntax

Delphi

type
  TRSChartLegend = class(TRSChartLabelMetaData)
  end; 
 

expandingConstructors

 

Name

Description

public constructor

Create(TRSCustomChartPanel)

Overloaded. Initializes a new instance of the TRSChartLegend class.

public destructor

Destroy

Represents the destructor of the TRSChartLegend class. (Overrides FMX.RS.ChartPanel.TRSCustomChartLabel.Destroy.)

Top

expandingProperties

 

Name

Description

published property

Align

Specifies the part of the chart panel ( FMX.RS.ChartPanel.TRSCustomChartPanel ) where the legend will be drawn

published property

Alignment

Represents property Alignment.

published property

Angle

Represents property Angle.

published property

BoxSize

Specifies the size in pixels for the color rectangle that is put next to each legend label. When a value or a chart is put on the legend, a small box or glyph with the color of the value or chart is put beside it. This property controls the size of the color box or glyph.

published property

Brush

Determines the color and pattern for filling the legend. Set the Brush property to specify the color and pattern to use when drawing the background or filling in graphical shapes in the legend. The value of Brush is a TBrush object. Set the properties of the TBrush object to specify the color and pattern or bitmap to use when filling in spaces on the legend canvas.
 

published property

FirstIndex

Specifies the index of the first visible line in the legend, usually 0. Change the FirstIndex if you want the legend to start displaying lines at something besides the first line.

published property

Fixed

Controls whether the legend automatically updates its Lines property. If Fixed is True, the legend will not try to automatically fill the Lines property.

alert_cautionWarning

If you set the Fixed property at design-time, the legend will not draw any boxes or glyphs

published property

Font

Represents property Font.

published property

FontFill

Represents property FontFill.

published property

LegendStyle

Controls the text style of the legend, e.g., what are the labels of the chart. (See RSChartConsts|TRSLegendStyle for more information). The legend uses the LegendStyle to determine what strings to put in the Lines property.

published property

Lines

Contains the strings that the legend displays. Usually, the legend fills the Lines property based on the   LegendStyle and   TextStyle as well as how many charts are being painted in the chart panel. Use the Lines property to provide quick access to the labels of the legend.

published property

Margins

Specifies the margins, or empty space, for the top, left, right, and bottom of the legend. Use the Margins property to specifies the legend margins in pixels.

published property

MaxColumns

Defines the maximum number of columns the legend will display.

published property

MaxRows

Defines the maximum number of rows or lines the legend will display. Be careful how large you set the MaxRows property as you can easily make the legend too big for the chart. If you increase the rows, you may want to also decrease the   Font size to allow the increased number of rows.

published property

MaxWidthPct

Constrains the width of the legend to a percentage of the total chart panel size. Usually, the width of the legend is dictated by the longest line in the Lines property. However, if that line is really long, this would mean that the legend would be bigger than the TRSCustomChartPanel.Width itself. This property constrains the width of the legend to a percentage of the chart panel width, by default 25%.

protected property

NeedsUpdate

Represents property NeedsUpdate.

public property

OnChange

Occurs immediately after the chart graphic object changes. Write an OnChange event handler to take specific action when the chart graphic changes. The properties of the chart graphic reflect the new settings when OnChange occurs.

alert_cautionWarning

For chart graphics that a chart or chart panel creates, you shouldn't assign a handler to this event. The chart or chart panel has already assigned an event handler.

public property

OnGetLegendStrings

Represents property OnGetLegendStrings.

published property

Opacity

Represents property Opacity.

published property

Options

Specifies the options for the legend box or glyph

published property

Overlay

Controls whether the legend is drawn on top of the charts in the chart panel or overlayed on top of the charts in the chart panel.

When Overlay is True, the charts are drawn at full size and the legend will be drawn over the charts and possibly obscuring them. When Overlay is False (the default), the legend occupies part of the chart panel and the charts are drawn in the other area. How much the legend occupies when Overlay is False is dependent on the MaxRows , MaxWidthPct and Align property. If Align is left or right, the legend occupies at most MaxWidthPct of the chart panel. If the legend is aligned with the top or bottom, the legend will occupy at most MaxRows lines (but usually less as the legend tries to create multiple columns in this case).

public property

Owner

Returns the FMX.RS.ChartPanel.TRSCustomChartPanel instance that owns this legend.

published property

Pen

Specifies the kind of pen the chart legend uses for drawing lines and outlining shapes. Set Pen to specify the pen to use for drawing lines and outlining shapes in the legend. The value of Pen is a TPen object in VCL or TStrokeBrush in FMX. Set the properties of the TRSPen object to specify the color, style, width, and mode of the pen.
 

published property

RectStyle

Defines the outer rectangle shape used for the legend

protected property

ResizeBounds

Represents property ResizeBounds.

published property

Shadow

Defines the shadow used for the legend. Use the properties of this class to modify the shadow of the legend. The shape of the shadow is defined by the   RectStyle property.

public property

Text

Specifies the text of the label (Inherited from FMX.RS.ChartPanel.TRSCustomChartLabel.)

published property

TextStyle

Defines the format for the FMX.RS.ChartPanel.TRSChartValue labels in the legend. The   FormatValue method uses this property to determine what string format to use.

published property

TextVerticalAlign

Represents property TextVerticalAlign.

published property

Visible

Represents property Visible.

Top

expandingMethods

 

Name

Description

public method

Assign(TPersistent)

Copies the contents of another similar object to the current object

alert_noteNotes to Inheritors

Most objects override Assign to handle the assignment of properties from similar objects. When overriding Assign, call the inherited method if the destination object cannot handle the assignment of properties from the class of the Source parameter

public method

BoundsRect(TCanvas,TCanvasRect,TCanvasPixel)

Returns the rectangle where the legend will be located on the Canvas. It also returns LongestWidth, which contains the longest text width of any label in the Lines property. What rectangle the BoundsRect method returns is dependent on the ARect parameter first of all, the labels being displayed in Lines, then the Align property, the MaxWidthPct, MaxRows, and Overlay properties.

Use the BoundsRect method to determine where the legend will draw itself.

protected method

Changed

Overloaded. Represents method Changed. (Inherited from FMX.RS.ChartPanel.TRSChartGraphic.)

public method

Clone

Creates a "deep" copy of the chart graphic. It constructs a new chart graphic of the correct type and then calls the   Assign method to copy its properties to the new copy. (Inherited from FMX.RS.ChartPanel.TRSChartGraphic.)

public method

Draw(TCanvas,TCanvasRect)

Overloaded. Paints the chart graphic to the specified Canvas in the specified location. It uses the current canvas' brush and pen. Use the Draw method to paint the chart graphic to any canvas and anywhere and with any size on the canvas.

alert_noteNotes to Inheritors

Descendant classes of TRSChartGraphic override the InternalDraw method to actually paint themselves.

public method

Draw(TCanvas,TCanvasRect,TRSChartAxis,TRSChartAxis)

Overloaded.  Paints the chart graphic to the specified Canvas in the specified location. It uses the current canvas' brush and pen. Use the Draw method to paint the chart graphic to any canvas and anywhere and with any size on the canvas.

The VertAxis and HorizAxis parameters can be used to provide point to pixel conversions (see FMX.RS.ChartPanel.TRSChartAxis ).

alert_noteNotes to Inheritors

Descendant classes of TRSChartGraphic override the InternalDraw method to actually paint themselves.

protected method

DrawGlyph(TCanvas,Integer,TCanvasPixel,TCanvasPixel)

Represents method DrawGlyph(TCanvas,Integer,TCanvasPixel,TCanvasPixel).

protected method

Drawing(TCanvas,TCanvasRect)

Represents method Drawing(TCanvas,TCanvasRect). (Overrides FMX.RS.ChartPanel.TRSChartGraphic.Drawing(TCanvas,TCanvasRect).)

protected method

DrawLabel(TCanvas,Integer,TCanvasPixel,TCanvasPixel,TCanvasPixel)

Represents method DrawLabel(TCanvas,Integer,TCanvasPixel,TCanvasPixel,TCanvasPixel).

protected method

Drawn(TCanvas,TCanvasRect)

Represents method Drawn(TCanvas,TCanvasRect). (Inherited from FMX.RS.ChartPanel.TRSChartGraphic.)

public method

FormatValue(TRSCustomChart,Integer)

Returns the label for the FMX.RS.ChartPanel.TRSChartValue at the Index position in the chart's   Values collection. The string returned is dependent on the TRSChartValue instance and the   TextStyle property.

protected method

FreeNotification(TObject)

Represents method FreeNotification(TObject). (Inherited from FMX.RS.ChartPanel.TRSChartGraphic.)

protected method

GetLegendStrings

Represents method GetLegendStrings.

protected method

GetText

Represents method GetText. (Inherited from FMX.RS.ChartPanel.TRSCustomChartLabel.)

protected method

Initialize

Represents method Initialize. (Overrides FMX.RS.ChartPanel.TRSCustomChartLabel.Initialize.)

protected method

InitializeEvents

Represents method InitializeEvents. (Overrides FMX.RS.ChartPanel.TRSCustomChartLabel.InitializeEvents.)

protected method

InternalDraw(TCanvas,TCanvasRect)

Represents method InternalDraw(TCanvas,TCanvasRect). (Overrides FMX.RS.ChartPanel.TRSCustomChartLabel.InternalDraw(TCanvas,TCanvasRect).)

public method

IsShowingCharts

Returns True if the legend will be displaying chart names in the legend. This value is dependent on the   LegendStyle as well as how many charts are visible in the chart panel.

protected method

LongestLine(TCanvas,TCanvasRect)

Represents method LongestLine(TCanvas,TCanvasRect).

protected method

SenderChanged(TObject)

Represents method SenderChanged(TObject). (Overrides FMX.RS.ChartPanel.TRSChartGraphic.SenderChanged(TObject).)

protected method

SetFont(TFont)

Represents method SetFont(TFont). (Overrides FMX.RS.ChartPanel.TRSCustomChartLabel.SetFont(TFont).)

protected method

SetText(String)

Represents method SetText(String). (Inherited from FMX.RS.ChartPanel.TRSCustomChartLabel.)

protected method

Size(TCanvas,TCanvasRect,TCanvasPixel)

Represents method Size(TCanvas,TCanvasRect,TCanvasPixel).

public method

TiledDraw(TCanvas,TCanvasRect,TTileGraphic,TCanvasPixel,TCanvasPixel)

Overloaded.  Tiles the image across the entire input rectangle.

The Image is drawn at full size from the top left of the ARect across and down until outside of the input rectangle. Use the overloaded TiledDraw methods to constrain the size of the Image.

public method

TiledDraw(TCanvas,TCanvasRect,TTileGraphic,TCanvasPixel,TCanvasPixel,TCanvasPixel,TCanvasPixel)

Overloaded.  Tiles the image across the entire input rectangle.

The Image is drawn at ImageWidth, ImageHeight size from the top left of the ARect across and down until outside of the input rectangle.

public method

TiledDraw(TCanvas,TCanvasRect,TTileGraphic,TCanvasRect)

Overloaded.  Tiles the image across the entire input rectangle.

The Image is drawn at ImageRect size from the top left of the ARect across and down until outside of the input rectangle.

protected method

VisibleChanged

Represents method VisibleChanged. (Inherited from FMX.RS.ChartPanel.TRSChartGraphic.)

Top

expandingEvents

 

Name

Description

public event

OnDraw

Occurs just after the chart graphic is painted. Write an OnDraw event handler to take specific action when the chart graphic has finished painting. The OnDraw event also allows you to do custom painting after the chart graphic has painted. (Inherited from FMX.RS.ChartPanel.TRSChartGraphic.)

public event

OnDrawing

Occurs just before the chart graphic is painted. Write an OnDrawing event handler to take specific action when the chart graphic is about to paint. If the event handler sets the DoDraw parameter to False, the chart graphic will not be painted. The OnDraw event also allows you to do custom painting before the chart graphic has been painted. (Inherited from FMX.RS.ChartPanel.TRSChartGraphic.)

Top

expandingSee Also

Comments (0)

RiverSoftAVG Charting Component Suite (RCCS) © 2005-2015, Thomas G. Grubb