Hide Comments
Hide Comments

Comments (0)

Provides a stand-alone legend component for a FMX.RS.ChartPanel.TRSChartPanel or FMX.RS.ChartPanel.TRSCustomChart. This legend may be placed anywhere a normal control can be placed in your form.

Use the Panel property to select the TRSChartPanel to display charts or chart values from. The Chart property can be used to select the specific chart to display its values. The    LegendStyle property controls what is displayed in the legend. The TRSLegendListBox component implements the FMX.RS.ChartPanel.IChartPanelListener interface.

Namespace: FMX.RS.ChartLegends

expandingInheritance Hierarchy

TListBox
  FMX.RS.ChartLegends.TRSLegendListBox
 

expandingSyntax

Delphi

type
  TRSLegendListBox = class(TListBox, IChartPanelListener)
  end; 
 

expandingConstructors

 

Name

Description

public constructor

Create(TComponent)

Initializes a new instance of the TRSLegendListBox class.

public destructor

Destroy

Represents the destructor of the TRSLegendListBox class.

Top

expandingProperties

 

Name

Description

published property

Chart

Specifies the chart that the legend should display values from. Note that this property will be set automatically to the active chart of a chart panel if the   Panel property is set.

published property

EnableSelection

Controls whether the legend will allow you to select chart values from the legend. In other words, as you click items in the legend, do the chart's values get Selected or not? Set EnableSelection to true if you want the user to be able to select chart values.

Note that if EnableSelection is true, MultiSelect is automatically true as the legend must display the selected chart values. Set EnableSelection to false if you want the legend to ignore user clicks on items.

published property

LegendStyle

Controls the text style of the legend, e.g., what are the labels of the chart. (See TRSLegendStyle for more information). The legend uses the LegendStyle to determine what items to display in the chart. If the LegendStyle is lsAutomatic, the legend shows the Captions of the TRSCustomCharts (if the   Panel is not nil and there is more than one chart attached to the panel) or the Captions of the TRSChartValues (if Panel is nil or there is only one chart attached to the Panel).

published property

LegendTextStyle

Defines the format for the labels in the legend. See TRSLegendTextStyle for more information.

protected property

NeedsUpdate

Represents property NeedsUpdate.

published property

Options

Specifies the options for the legend box or glyph

published property

Panel

Specifies the TRSChartPanel that the legend should display charts and/or values for. Set the Panel property if you want the legend to display a legend similar to the Legend of the TRSChartPanel. In this case, the legend will display all the chart names if there is more than one chart attached to the panel. However, if there is only one chart attached to the panel, the legend would display the chart's values. To only display one chart's values, leave the Panel property blank and set the   Chart property.

published property

ShowCheckBoxes

Controls whether the legend shows check boxes for the visibility of the chart or chart values. Set ShowCheckBoxes to true if you want the legend to show check boxes. The check boxes will be checked for all visible charts or chart values. The user can then check or uncheck the boxes to control the visibility of the chart or values. Set ShowCheckBoxes to false to hide the check boxes and prevent the user from changing chart or value visibilities.

published property

ShowScrollBars

Represents property ShowScrollBars.

Top

expandingMethods

 

Name

Description

public method

AddObject(TFmxObject)

Represents method AddObject(TFmxObject).

protected method

Change

Represents method Change.

protected method

ChartAdded(TRSCustomChart)

Called when chart is added to panel

protected method

ChartChanged(TRSCustomChart)

Called when a chart or a chart value has changed

protected method

ChartDeleted(TRSCustomChart)

Called when chart is deleted/removed from panel

protected method

DoApplyItemStyleLookup(TObject)

Represents method DoApplyItemStyleLookup(TObject).

protected method

DoChangeCheck(TListBoxItem)

Represents method DoChangeCheck(TListBoxItem).

protected method

DoPaintChartValue(TObject,TCanvas)

Represents method DoPaintChartValue(TObject,TCanvas).

protected method

GetDefaultStyleLookupName

Represents method GetDefaultStyleLookupName.

public method

Invalidate

Represents method Invalidate.

protected method

Notification(TComponent,TOperation)

Represents method Notification(TComponent,TOperation).

public method

Painting

Represents method Painting.

protected method

PanelChange

Called when the panel has changed and everything needs to be refreshed

public method

RebuildLegend

Rebuilds the items of the legend. Call this method to force the legend list box to update. Usually, you should never need to call this method because the legend ensures its items are updated before painting itself. In rare cases, however, you may want to force the legend to update itself immediately and not wait until painting itself.

The legend fills its Items property based on the values in the     Chart and/or     Panel properties. The Objects of the Items: TStrings contains the associated FMX.RS.ChartPanel.TRSCustomChart or FMX.RS.ChartPanel.TRSChartValue object.
 

protected method

SelectionChanged(TObject)

Called when FMX.RS.ChartPanel.TRSChartValue.Selected property has changed

protected method

ValueChanged(TRSCustomChart,TRSChartValue)

Called when a chart value has changed.

The Value = nil when ALL values have been changed

protected method

VisibleChanged(TObject)

Called when FMX.RS.ChartPanel.TRSCustomChart.Visible property or the TRSChartValue.Visible property has changed

Top

expandingRemarks

Unlike the chart panel legend ( FMX.RS.ChartPanel.TRSChartLegend ), the legend list box displays all values or charts in the legend and is not concatenated to fit within the panel. The TRSLegendListBox component displays checkmarks for all visible charts or values. Uncheck a chart or value to hide it, check a chart or value to display it. The TRSLegendListBox component can also be used to select (  Selected property) specific values of a chart. More than one TRSLegendListBox may be used at a time.

expandingExamples

To display a list of all the charts of a chart panel:

Drop a FMX.RS.ChartPanel.TRSChartPanel and charts on a form
Drop a FMX.RS.ChartLegends.TRSLegendListBox component on a form
Set the Panel property of the TRSLegendListBox to the TRSChartPanel
Change the LegendStyle to lsChartNames. If you leave the LegendStyle as lsAutomatic, the legend will display all the chart names if there is more than one chart attached to the panel. However, if there is only one chart attached to the panel, the legend would display the chart's values. Use lsChartNames to force the legend to always display only the charts attached to the chart panel.

To display one chart's values:

Drop a chart on a form. Note that the chart does not have to be visible or attached to a chart panel to display the values of the chart in the legend.
Drop a FMX.RS.ChartLegends.TRSLegendListBox component on a form
Set the Chart property of the TRSLegendListBox to the chart
 
expandingSee Also

Comments (0)

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