The TRSBubbleChart component is a RSChartPanel.TRSCustomChart descendant that represents a bubble chart.
Each chart value ( RSBubbleCharts.TRSBubbleChartValue ) is displayed as one bubble in the bubble chart. The size of the bubbles can represent the area of the bubbles or the diameter of the bubble (controlled by the
SizeOption property of TRSBubbleChartValues), which affects the relative size of one bubble to another.
Bubble sizes can be negative values, although negative bubbles do not display in the chart by default (
NegativeSizeVisible must be true). When negative bubble sizes are displayed, they use their absolute size and are always drawn using the
NegativeSizeColor.
Important Note
|
Note that for drawing purposes, the bubble size is proportional to the greatest bubble size in the collection of bubbles. Only the largest bubble is drawn with its correct diameter or area.
|
Note
|
Charts are TGraphicControl descendants for VCL and TControl descendants for FMX. Display charts on a chart panel (with integrated axes, legend, header, footers, etc) or stand-alone (allowing use of FMX effects or embedding within other controls). Set the Panel property to the RSChartPanel.TRSChartPanel you want the chart displayed inside or nil for stand-alone use.
|
Namespace: RSBubbleCharts
Delphi
|
type
TRSBubbleChart = class(TRSChart)
end;
|
|
Name
|
Description
|
|
Align
|
Represents property Align. (Inherited from RSCharts.TRSChart.)
|
|
Alignment
|
Specifies the location to draw the caption on the bubble.
|
|
Anchors
|
Represents property Anchors. (Inherited from RSCharts.TRSChart.)
|
|
AxesHints
|
(Inherited from RSChartPanel.TRSCustomChart.)
|
|
Brush
|
Represents property Brush. (Inherited from RSCharts.TRSChart.)
|
|
Caption
|
Represents property Caption. (Inherited from RSCharts.TRSChart.)
|
|
Color
|
Represents property Color. (Inherited from RSCharts.TRSChart.)
|
|
ColorList
|
Defines the color list to use when new chart values are created. When a chart value is created and a color is not specified, the object will get a new color based on the next color in the list. If the list is at the end, the new color will be the first color in the list.
Set the ColorList property directly to define your own custom color scheme. Set the ColorScheme property to use one of the predefined color lists.
Note
|
The new color list will be applied to the existing chart values.
|
|
|
ColorScheme
|
Represents property ColorScheme. (Inherited from RSCharts.TRSChart.)
|
|
Constraints
|
Represents property Constraints. (Inherited from RSCharts.TRSChart.)
|
|
Cursor
|
Specifies the Cursor to display when the mouse is over the chart (Inherited from RSChartPanel.TRSCustomChart.)
|
|
Enabled
|
Represents property Enabled. (Inherited from RSCharts.TRSChart.)
|
|
FirstIndex
|
The FirstIndex and the LastIndex properties define the indices of the Values that are currently being drawn in the chart.
Usually, these properties are equivalent to 0 for the FirstIndex and Values.Count-1 for the LastIndex. However, when the TRSChartPanel component has been zoomed, these properties reflect the point just before the first point in the zoomed area and the point just after the last point in the zoomed area (this ensures the visual aspect of the chart by allowing, for example, lines to be drawn into and out of the zoomed area. The FirstIndex and LastIndex properties provide more efficient access to only the values that are currently being drawn.
Note
|
For charts that don't have an easy visual ordering (such as a shape chart where depending on sizes things can overlap), the FirstIndex and LastIndex will be the entire Values collection.
|
|
|
Font
|
Represents property Font. (Inherited from RSCharts.TRSChart.)
|
|
Group
|
Represents property Group. (Inherited from RSCharts.TRSChart.)
|
|
GroupIndex
|
Use the GroupIndex property to specify the ordering of the charts in a group at design time (Inherited from RSChartPanel.TRSCustomChart.)
|
|
GroupStyle
|
Represents property GroupStyle. (Inherited from RSCharts.TRSChart.)
|
|
HorizAxis
|
Represents property HorizAxis. (Inherited from RSCharts.TRSChart.)
|
|
HorizontalAxis
|
Represents property HorizontalAxis. (Inherited from RSCharts.TRSChart.)
|
|
ImageList
|
Lists the images available for points and shapes in the chart. ImageList is a list of bitmaps that can be displayed for any point in the chart. A point ( RSCharts.TRS2DImageChartValue item) is associated with an image from this image list by its ImageIndex property. This image will only appear for the point if the ImageIndex is valid for the list and the PointsInfo.Style is ssImage
|
|
LastIndex
|
The FirstIndex and the LastIndex properties define the indices of the Values that are currently being drawn in the chart.
Usually, these properties are equivalent to 0 for the FirstIndex and Values.Count-1 for the LastIndex. However, when the TRSChartPanel component has been zoomed, these properties reflect the point just before the first point in the zoomed area and the point just after the last point in the zoomed area (this ensures the visual aspect of the chart by allowing, for example, lines to be drawn into and out of the zoomed area. The FirstIndex and LastIndex properties provide more efficient access to only the values that are currently being drawn.
Note
|
For charts that don't have an easy visual ordering (such as a shape chart where depending on sizes things can overlap), the FirstIndex and LastIndex will be the entire Values collection.
|
|
|
Listeners
|
Tracks the RSChartPanel.IChartPanelListeners which are listening for changes to this chart. The TRSCustomChart class uses this list to automatically notify listeners when the chart or its values change.
Add a class to this list in order for it to receive change events from the chart.
|
|
LocalHorizontalAxis
|
Represents property LocalHorizontalAxis. (Inherited from RSChartPanel.TRSCustomChart.)
|
|
LocalVerticalAxis
|
Represents property LocalVerticalAxis. (Inherited from RSChartPanel.TRSCustomChart.)
|
|
MaxBubbleSize
|
Specifies the maximum bubble size as percentage (0-1) of the chart area
|
|
MinBubbleSize
|
Specifies the minimum bubble size as percentage (0-1) of the chart area
|
|
NegativeSizeColor
|
Defines the color to use for Bubbles that have sizes less than 0. Bubble sizes can be negative values, although negative bubbles do not display in the chart by default ( NegativeSizeVisible must be true). When negative bubble sizes are displayed, they use their absolute size and are always drawn using the NegativeSizeColor.
|
|
NegativeSizeVisible
|
Specifies whether to display bubble that have sizes less than 0. Bubble sizes can be negative values, although negative bubbles do not display in the chart by default ( NegativeSizeVisible must be true). When negative bubble sizes are displayed, they use their absolute size and are always drawn using the NegativeSizeColor.
|
|
OffsetVertical
|
Represents property OffsetVertical. (Inherited from RSCharts.TRSChart.)
|
|
OnCanResize
|
Represents property OnCanResize. (Inherited from RSCharts.TRSChart.)
|
|
OnChange
|
Represents property OnChange. (Inherited from RSCharts.TRSChart.)
|
|
OnClick
|
Represents property OnClick. (Inherited from RSCharts.TRSChart.)
|
|
OnConstrainedResize
|
Represents property OnConstrainedResize. (Inherited from RSCharts.TRSChart.)
|
|
OnContextPopup
|
Represents property OnContextPopup. (Inherited from RSCharts.TRSChart.)
|
|
OnDblClick
|
Represents property OnDblClick. (Inherited from RSCharts.TRSChart.)
|
|
OnDragDrop
|
Represents property OnDragDrop. (Inherited from RSCharts.TRSChart.)
|
|
OnDragOver
|
Represents property OnDragOver. (Inherited from RSCharts.TRSChart.)
|
|
OnDraw
|
Represents property OnDraw. (Inherited from RSCharts.TRSChart.)
|
|
OnDrawing
|
Represents property OnDrawing. (Inherited from RSCharts.TRSChart.)
|
|
OnEndDock
|
Represents property OnEndDock. (Inherited from RSCharts.TRSChart.)
|
|
OnEndDrag
|
Represents property OnEndDrag. (Inherited from RSCharts.TRSChart.)
|
|
OnMouseActivate
|
Represents property OnMouseActivate. (Inherited from RSCharts.TRSChart.)
|
|
OnMouseDown
|
Represents property OnMouseDown. (Inherited from RSCharts.TRSChart.)
|
|
OnMouseEnter
|
Represents property OnMouseEnter. (Inherited from RSCharts.TRSChart.)
|
|
OnMouseLeave
|
Represents property OnMouseLeave. (Inherited from RSCharts.TRSChart.)
|
|
OnMouseMove
|
Represents property OnMouseMove. (Inherited from RSCharts.TRSChart.)
|
|
OnMouseUp
|
Represents property OnMouseUp. (Inherited from RSCharts.TRSChart.)
|
|
OnMouseWheel
|
Represents property OnMouseWheel. (Inherited from RSCharts.TRSChart.)
|
|
OnMouseWheelDown
|
Represents property OnMouseWheelDown. (Inherited from RSCharts.TRSChart.)
|
|
OnMouseWheelUp
|
Represents property OnMouseWheelUp. (Inherited from RSCharts.TRSChart.)
|
|
OnResize
|
Represents property OnResize. (Inherited from RSCharts.TRSChart.)
|
|
OnStartDock
|
Represents property OnStartDock. (Inherited from RSCharts.TRSChart.)
|
|
OnStartDrag
|
Represents property OnStartDrag. (Inherited from RSCharts.TRSChart.)
|
|
OnValueChange
|
Represents property OnValueChange. (Inherited from RSCharts.TRSChart.)
|
|
OnValueSelectionChange
|
Represents property OnValueSelectionChange. (Inherited from RSCharts.TRSChart.)
|
|
OnValueVisibleChange
|
Represents property OnValueVisibleChange. (Inherited from RSCharts.TRSChart.)
|
|
OnVisibleChange
|
Represents property OnVisibleChange. (Inherited from RSCharts.TRSChart.)
|
|
Opacity
|
Represents property Opacity. (Inherited from RSCharts.TRSChart.)
|
|
Options
|
Represents property Options. (Inherited from RSCharts.TRSChart.)
|
|
Panel
|
Represents property Panel. (Inherited from RSCharts.TRSChart.)
|
|
PanelColorScheme
|
Specifies which color scheme to use when new chart values are created with default color values. If Panel is not nil and this property is True, then the chart panel's ChartColorScheme is used. Otherwise, the ColorScheme is used (Inherited from RSChartPanel.TRSCustomChart.)
|
|
ParentFont
|
Represents property ParentFont. (Inherited from RSCharts.TRSChart.)
|
|
ParentSelectionColor
|
Represents property ParentSelectionColor. (Inherited from RSCharts.TRSChart.)
|
|
Pen
|
Represents property Pen. (Inherited from RSCharts.TRSChart.)
|
|
PopupMenu
|
Represents property PopupMenu. (Inherited from RSCharts.TRSChart.)
|
|
Preview
|
Represents property Preview. (Inherited from RSCharts.TRSChart.)
|
|
SelectionColor
|
Represents property SelectionColor. (Inherited from RSCharts.TRSChart.)
|
|
ShowHint
|
Represents property ShowHint. (Inherited from RSCharts.TRSChart.)
|
|
SizeOption
|
Specifies whether sizes of the bubbles are interpreted to be diameter or area. The size of the bubbles can represent the area of the bubbles or the diameter of the bubble, which affects the relative size of one bubble to another.
|
|
State
|
Represents property State. (Inherited from RSChartPanel.TRSCustomChart.)
|
|
Style
|
Defines the geometric shape used for every bubble in a bubble chart
|
|
ValueLabelFormat
|
Represents property ValueLabelFormat. (Inherited from RSCharts.TRSChart.)
|
|
ValueLabelStyle
|
Represents property ValueLabelStyle. (Inherited from RSCharts.TRSChart.)
|
|
Values
|
The Values property contains all the bubbles in the bubble chart. Each bubble (TRSBubbleChartValue) may have its own Color and Caption. The size of the bubble is specified by the Size property. The size of the bubbles can represent the area of the bubbles or the diameter of the bubble (controlled by the SizeOption property of TRSBubbleChartValues), which affects the relative size of one bubble to another.
Bubble sizes can be negative values, although negative bubbles do not display in the chart by default ( NegativeSizeVisible must be true). When negative bubble sizes are displayed, they use their absolute size and are always drawn using the NegativeSizeColor.
Use the Values collection to add, delete, and modify bubbles in the chart.
|
|
VertAxis
|
Represents property VertAxis. (Inherited from RSCharts.TRSChart.)
|
|
VerticalAxis
|
Represents property VerticalAxis. (Inherited from RSCharts.TRSChart.)
|
|
Visible
|
Represents property Visible. (Inherited from RSCharts.TRSChart.)
|
|
VisibleCount
|
Returns the number of TRSChartValue that are visible for the chart (Inherited from RSChartPanel.TRSCustomChart.)
|
Top
|
(Inherited from RSChartPanel.TRSCustomChart.)
DrawAxes(TCanvas,TCanvasRect,TRSChartAxis,TRSChartAxis)
Draws the specified axes to the Canvas (Inherited from RSChartPanel.TRSCustomChart.)
DrawBubble(TCanvas,TCanvasRect,TRSBubbleChartValue)
Represents method DrawBubble(TCanvas,TCanvasRect,TRSBubbleChartValue).
DrawGlyph(TCanvas,TCanvasRect)
Overloaded. Represents method DrawGlyph(TCanvas,TCanvasRect). (Inherited from RSChartPanel.TRSCustomChart.)
DrawGlyph(TCanvas,TRSChartValue,TCanvasRect)
Represents method DrawGlyph(TCanvas,TRSChartValue,TCanvasRect). (Overrides RSChartPanel.TRSCustomChart.DrawGlyph(TCanvas,TRSChartValue,TCanvasRect).)
Drawing(TCanvas,TCanvasRect)
Calls the OnDrawing event and returns True if the draw process should continue.
This method is called before the InternalDraw method.
DrawLabel(TCanvas,String,TCanvasPixel,TCanvasPixel,Single)
Overloaded. Draws the text caption centered above the X, Y point without clipping.
Note
|
The Opacity is ignored in VCL
|
DrawLabel(TCanvas,String,TCanvasRect,Single)
Overloaded. Draws the text caption centered within the rectangle. The text is clipped
Note
|
The Opacity is ignored in VCL
|
DrawLabel(TCanvas,TRSChartValue,TCanvasPixel,TCanvasPixel)
Overloaded. Draws the text caption centered above the X, Y point without clipping.
DrawLabel(TCanvas,TRSChartValue,TCanvasRect)
Draws a label for the TRSChartValue on the canvas. The text of the label is controlled by the ValueLabelStyle property.
The label is drawn within the specified rectangle.
Drawn(TCanvas,TCanvasRect)
Calls the OnDraw event.
This method is called after the InternalDraw method.
EndUpdate
Re-enables screen repainting and change events. Use EndUpdate to re-enable screen repainting and change events that were turned off with the BeginUpdate method. (Inherited from RSChartPanel.TRSCustomChart.)
FormatValue(TRSChartValue,TRSLabelTextStyle)
Generates a label for the Value based on the TextStyle (Inherited from RSChartPanel.TRSCustomChart.)
GetAdjOffsetVertical
Returns the vertical offset ( OffsetVertical).
If coUseVerticalOffset is not in Options, this method always returns 0. If coUseVerticalOffset is in Options, the function returns the OffsetVertical value.
GetAxisCaption(TRSChartAxis,Integer,TRSChartValueType)
Returns a label for an axis ( RSChartPanel.TRSChartAxis ) based on the input Value. The Index specifies where to start looking in the chart Values (for optimization purposes) and decrements from there until the closest chart value is found. (Inherited from RSChartPanel.TRSCustomChart.)
GetChartType
Returns the chart type enumerated value for this class. Each chart class overrides this class function to return the RSChartConsts|TRSChartType enumerated value (Overrides RSChartPanel.TRSCustomChart.GetChartType.)
GetColor
Overloaded. Represents method GetColor. (Inherited from RSChartPanel.TRSCustomChart.)
GetColor(TRSChartValue)
Overloaded. Returns the color of the chart value. The color of the TRSChartValue can change depending on the Options property as well as any other chart states (e.g., the TRSCandleStickChart class overrides this method to turn the color red or green depending on if the Open value is greater than the Closing Value) (Inherited from RSChartPanel.TRSCustomChart.)
GetCumulativeTotal(Integer,Integer,TRSCustomChartClass)
Determine the cumulative value at this index for all charts in the Group. The ValIndex specifies the TRSChartValue.Values dimension to compare.
Used for stacking charts.
GetCumulativeValue(Integer,Integer,TRSCustomChartClass)
Determine the cumulative value at this index for all charts below (spatially) this chart in the same Group. The ValIndex specifies the TRSChartValue.Values dimension to compare.
Used for stacking charts.
GetGroupDimension
Represents method GetGroupDimension. (Inherited from RSChartPanel.TRSCustomChart.)
GetValueColor
Returns a new chart color based on the ChartColorScheme and ChartColorList. Every time a chart is created, it is assigned a new color from the current ChartColorList. (Inherited from RSChartPanel.TRSCustomChart.)
InitializeChangeEvents
Initialize the OnChange events of structures. Use this method to assign event handlers for structures (e.g., Pen.OnChange := MyChangeMethod).
Notes to Inheritors
|
The constructor calls this method after it calls the InitializeChart method, which is where the structures should be actually created and initialized.
|
InitializeChart
Creates and initialize structures and values of chart. This method is the safe place to initialize chart values without change events occurring.
Notes to Inheritors
|
The constructor calls this method. Use this method to actually create and initialize properties. Do not assign event properties in this method (use the InitializeChangeEvents method instead)
|
InternalDraw(TCanvas,TCanvasRect)
Paints the chart graphic to the specified canvas at the specified rectangle. The InternalDraw method is called by the Draw method.
Descendant classes of TRSCustomChart override the InternalDraw method to actually paint themselves.
Notes to Inheritors
|
The default InternalDraw method implementation assigns the Brush, Pen , and Font to the Canvas.
|
InternalSelect(TCanvasRect,TRSChartSelectionAction)
Selects or deselects chart Values ( RSChartPanel.TRSChartValue ) based on whether they intersect with the selection rectangle (which is in pixel coordinates).
The base method converts the SelectionRect to chart coordinates (based on HorizontalAxis and VerticalAxis) and then selects values based on the TRSChartValue.Selectable method
IsSelectable(TCanvasRect)
Returns True if any value in the chart intersects with the SelectionRect (Inherited from RSChartPanel.TRSCustomChart.)
IsValuesStored
Represents method IsValuesStored. (Inherited from RSChartPanel.TRSCustomChart.)
IsVisible
Indicates whether the chart is visible. A chart is visible if its Visible property is True and both axes have been assigned. (Inherited from RSChartPanel.TRSCustomChart.)
Loaded
Represents method Loaded. (Inherited from RSChartPanel.TRSCustomChart.)
MouseHover(TCanvasRect)
Represents method MouseHover(TCanvasRect). (Inherited from RSChartPanel.TRSCustomChart.)
Notification(TComponent,TOperation)
Represents method Notification(TComponent,TOperation). (Inherited from RSChartPanel.TRSCustomChart.)
Paint
Represents method Paint. (Inherited from RSChartPanel.TRSCustomChart.)
PanelChanged
Represents method PanelChanged. (Inherited from RSChartPanel.TRSCustomChart.)
SaveCanvasResources(TCanvas,TBrush,TRSPen,TFont)
Represents method SaveCanvasResources(TCanvas,TBrush,TRSPen,TFont). (Inherited from RSChartPanel.TRSCustomChart.)
Select(TCanvasRect,TRSChartSelectionAction)
Selects or deselects chart Values ( RSChartPanel.TRSChartValue ) based on whether they intersect with the selection rectangle (which is in pixel coordinates).
The base method converts the SelectionRect to chart coordinates (based on HorizontalAxis and VerticalAxis) and then selects values based on the TRSChartValue.Selectable method
Notes to Inheritors
|
Descendant classes override the InternalSelect method
|
SelectionColorChanged
Represents method SelectionColorChanged. (Inherited from RSChartPanel.TRSCustomChart.)
SenderChanged(TObject)
Overloaded. Represents method SenderChanged(TObject). (Inherited from RSChartPanel.TRSCustomChart.)
SetCanvasResources(TCanvas,TBrush,TRSPen,TFont,Boolean,Boolean)
Overloaded. Represents method SetCanvasResources(TCanvas,TBrush,TRSPen,TFont,Boolean,Boolean). (Inherited from RSChartPanel.TRSCustomChart.)
SetCanvasResources(TCanvas,TRSChartValue,Boolean,Boolean)
Overloaded. Represents method SetCanvasResources(TCanvas,TRSChartValue,Boolean,Boolean). (Inherited from RSChartPanel.TRSCustomChart.)
SetColor(TCanvasColor)
Represents method SetColor(TCanvasColor). (Inherited from RSChartPanel.TRSCustomChart.)
SetOptions(TChartOptions)
Represents method SetOptions(TChartOptions). (Inherited from RSChartPanel.TRSCustomChart.)
UpdateAxisInfo(TRSChartAxis)
Represents method UpdateAxisInfo(TRSChartAxis). (Inherited from RSChartPanel.TRSCustomChart.)
UpdateColorScheme
Updates the values to the current color scheme. If PanelColorScheme is True then uses the Panel's color scheme (Inherited from RSChartPanel.TRSCustomChart.)
ValueSelectionChanged(TRSChartValue)
Represents method ValueSelectionChanged(TRSChartValue). (Inherited from RSChartPanel.TRSCustomChart.)
ValueVisibleChanged(TRSChartValue)
Represents method ValueVisibleChanged(TRSChartValue). (Inherited from RSChartPanel.TRSCustomChart.)
VisibleChanged
Represents method VisibleChanged. (Inherited from RSChartPanel.TRSCustomChart.)
WantsCaptions(TRSChartAxis)
Returns true if the chart prefers Captions over Values for its labels on the input Axis. This method provides a hint to the TRSChartAxis when LabelStyle is alsAutomatic. (Inherited from RSChartPanel.TRSCustomChart.)
Top
|
Name
|
Description
|
|
OnCustomDrawValue
|
Occurs when a point is being drawn. Use the OnCustomDrawValue event to do custom drawing of the point. Set DoDraw to false to prevent the class from drawing the default point.
|
Top
|
Note that by default, the bubbles are sorted from largest to smallest. This ensures that larger bubbles don't obscure smaller bubbles.
|
To display a chart, you drop the component on a form and optionally connect its Panel property to the RSChartPanel.TRSChartPanel component where you want it to be displayed.
To display a bubble chart:
• | Drop a TRSBubbleChart component on a form |
• | Drop a TRSChartPanel component where you want the chart to be displayed. (Note, more than one chart can share the same chart panel) |
• | Connect the Panel property of the chart to the chart panel |
|
To add a bubble to the chart (at Design-Time):
• | Select the TRSBubbleChart component |
• | Click the ellipsis button (...) for the Values property of the chart. This action displays Delphi's Collection Editor for the TRSBubbleChartValues collection. |
• | Use the Add button to add bubbles (TRSBubbleChartValue collection item) to the chart.
|
• | Edit the X and Y properties to specify where the location of the bubble |
• | Edit the Size to specify the size of the bubble as a diameter or area, dependent on SizeOption. Note that this size is not the absolute size of the bubble but is proportional to all the other bubbles in the chart
|
|
To add a bubble to the chart (at Run-Time):
Delphi
|
var
Value: TRSBubbleChartValue; // note, this type should be the same that the chart uses (e.g., TRS2DChartValue, TRSArrowChartValue, etc)
begin
// Add bubble
Value := MyChart.Values.Add;
Value.Color := clRed;
Value.Size := 45.0;
end;
|