Show/Hide Toolbars

RiverSoftAVG Products Help

Navigation: Code Documentation > RSCharting > RSBarCharts > Classes

TRSHighLowAverageChart Class

Scroll Prev Top Next More

The TRSHighLowAverageChart component is a RSBarCharts.TRSCustomSparseBarChart descendant that represents a high/low/average bar chart, i.e., bars that can show a vertical range. The High/Low/Average Bar Chart displays each chart value ( RSBarCharts.TRSHighLowAverageChartValue ) as a vertical or horizontal bar (depending on    Orientation). A HighLowAverage chart is something like a combination of a line-chart and a bar-chart: each bar represents three important pieces of information: the Average (as line on side of bar), and the high and the low. Each value draws a separate bar and the order of the bars is based on the order of the TRSHighLowAverageChartValue in the collection.

The TRSHighLowAverageChartValue class uses the Value property to specify the height of each bar. The X property specifies where in the horizontal axis that bar is located.
 

ChartFunctionExample

noteNote

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: RSBarCharts

 (Inherited from RSChartPanel.TRSCustomChart.)

protected method

DrawAverageLine(TCanvas,TCanvasRect,TRSHighLowAverageChartValue,THighLowAverageStyle,Boolean)

Draw the line for the average on the side of the bar

public method

DrawAxes(TCanvas,TCanvasRect,TRSChartAxis,TRSChartAxis)

Draws the specified axes to the Canvas (Inherited from RSChartPanel.TRSCustomChart.)

protected method

DrawBar(TCanvas,TCanvasRect,TRSBarChartValue)

Represents method DrawBar(TCanvas,TCanvasRect,TRSBarChartValue). (Inherited from RSBarCharts.TRSCustomBarChart.)

public method

DrawGlyph(TCanvas,TCanvasRect)

Overloaded. Represents method DrawGlyph(TCanvas,TCanvasRect). (Inherited from RSChartPanel.TRSCustomChart.)

public method

DrawGlyph(TCanvas,TRSChartValue,TCanvasRect)

Represents method DrawGlyph(TCanvas,TRSChartValue,TCanvasRect). (Overrides RSBarCharts.TRSCustomBarChart.DrawGlyph(TCanvas,TRSChartValue,TCanvasRect).)

protected method

DrawHLABar(TCanvas,TCanvasRect,TRSHighLowAverageChartValue,Boolean)

Draw the High/Low/Average Bar Shape

protected method

Drawing(TCanvas,TCanvasRect)

Calls the OnDrawing event and returns True if the draw process should continue.

This method is called before the InternalDraw method.

public method

DrawLabel(TCanvas,String,TCanvasPixel,TCanvasPixel,Single)

Overloaded. Draws the text caption centered above the X, Y point without clipping.

noteNote

The Opacity is ignored in VCL

public method

DrawLabel(TCanvas,String,TCanvasRect,Single)

Overloaded. Draws the text caption centered within the rectangle. The text is clipped

noteNote

The Opacity is ignored in VCL

public method

DrawLabel(TCanvas,TRSChartValue,TCanvasPixel,TCanvasPixel)

Overloaded. Draws the text caption centered above the X, Y point without clipping.

noteNote

The Opacity is specified by the RSChartPanel.TRSChartValue.Opacity property

public method

DrawLabel(TCanvas,TRSChartValue,TCanvasRect)

Overloaded.  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.

noteNote

The Opacity is specified by the RSChartPanel.TRSChartValue.Opacity property

protected method

Drawn(TCanvas,TCanvasRect)

Calls the OnDraw event.

This method is called after the InternalDraw method.

public 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.)

public method

FormatValue(TRSChartValue,TRSLabelTextStyle)

Generates a label for the Value based on the TextStyle (Inherited from RSChartPanel.TRSCustomChart.)

public method

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.

public method

GetAdjOrigin

Returns the adjusted origin for the bar chart. If the     UseOriginproperty is set, this value is the Origin. If the UseOrigin property is false, the adjusted origin equals 0.

Note that when bar charts are stacked (see GroupStyle=gsStacked), the bottom-most bar chart adjusted origin is used as the origin for all the bar charts.
 

public method

GetAxisCaption(TRSChartAxis,Integer,Double)

Represents method GetAxisCaption(TRSChartAxis,Integer,Double). (Inherited from RSBarCharts.TRSCustomSparseBarChart.)

protected method

GetBarRect(TCanvasRect,TRSBarChartValue)

Overloaded. Returns the canvas rectangle in pixels for the bar value (Inherited from RSBarCharts.TRSCustomBarChart.)

protected method

GetBarRect(TCanvasRect,TRSBarChartValue,TRSCustomChart,TRSChartValueType,TRSChartValueType,TRSChartValueType)

Returns the canvas rectangle in pixels for the bar value. (Overrides RSBarCharts.TRSCustomSparseBarChart.GetBarRect(TCanvasRect,TRSBarChartValue,TRSCustomChart,TRSChartValueType,TRSChartValueType,TRSChartValueType).)

protected method

GetBarStyle(TRSBarChartValue)

Returns the bar style of the value (Inherited from RSBarCharts.TRSCustomBarChart.)

public methodClass member

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 RSBarCharts.TRSCustomSparseBarChart.GetChartType.)

protected method

GetColor

Overloaded. Represents method GetColor. (Inherited from RSChartPanel.TRSCustomChart.)

public method

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.)

public method

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.

public method

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.

protected method

GetGroupDimension

Represents method GetGroupDimension. (Overrides RSChartPanel.TRSCustomChart.GetGroupDimension.)

public method

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.)

protected method

InitializeChangeEvents

Initialize the OnChange events of structures. Use this method to assign event handlers for structures (e.g., Pen.OnChange := MyChangeMethod).

alert_noteNotes to Inheritors

The constructor calls this method after it calls the InitializeChart method, which is where the structures should be actually created and initialized.

protected method

InitializeChart

Creates and initialize structures and values of chart. This method is the safe place to initialize chart values without change events occurring.

alert_noteNotes 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)

protected method

InternalDraw(TCanvas,TCanvasRect)

Overloaded.  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.

alert_noteNotes to Inheritors

The default InternalDraw method implementation assigns the     Brush, Pen , and Font to the Canvas.

protected method

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

public method

IsSelectable(TCanvasRect)

Returns True if any value in the chart intersects with the SelectionRect (Inherited from RSChartPanel.TRSCustomChart.)

protected method

IsValuesStored

Represents method IsValuesStored. (Inherited from RSChartPanel.TRSCustomChart.)

public method

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.)

protected method

Loaded

Represents method Loaded. (Inherited from RSChartPanel.TRSCustomChart.)

protected method

MouseHover(TCanvasRect)

Represents method MouseHover(TCanvasRect). (Inherited from RSChartPanel.TRSCustomChart.)

protected method

Notification(TComponent,TOperation)

Represents method Notification(TComponent,TOperation). (Overrides RSChartPanel.TRSCustomChart.Notification(TComponent,TOperation).)

protected method

Paint

Represents method Paint. (Inherited from RSChartPanel.TRSCustomChart.)

protected method

PanelChanged

Represents method PanelChanged. (Inherited from RSChartPanel.TRSCustomChart.)

protected method

RSVisibleChanged

Represents method RSVisibleChanged. (Inherited from RSChartPanel.TRSCustomChart.)

protected method

SaveCanvasResources(TCanvas,TBrush,TRSPen,TFont)

Represents method SaveCanvasResources(TCanvas,TBrush,TRSPen,TFont). (Inherited from RSChartPanel.TRSCustomChart.)

public method

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

alert_noteNotes to Inheritors

Descendant classes override the InternalSelect method

protected method

SelectionColorChanged

Represents method SelectionColorChanged. (Inherited from RSChartPanel.TRSCustomChart.)

protected method

SenderChanged(TObject)

Overloaded. Represents method SenderChanged(TObject). (Inherited from RSChartPanel.TRSCustomChart.)

protected method

SetCanvasResources(TCanvas,TBrush,TRSPen,TFont,Boolean,Boolean)

Overloaded. Represents method SetCanvasResources(TCanvas,TBrush,TRSPen,TFont,Boolean,Boolean). (Inherited from RSChartPanel.TRSCustomChart.)

protected method

SetCanvasResources(TCanvas,TRSChartValue,Boolean,Boolean)

Overloaded. Represents method SetCanvasResources(TCanvas,TRSChartValue,Boolean,Boolean). (Inherited from RSChartPanel.TRSCustomChart.)

protected method

SetColor(TCanvasColor)

Represents method SetColor(TCanvasColor). (Inherited from RSChartPanel.TRSCustomChart.)

protected method

SetOptions(TChartOptions)

Represents method SetOptions(TChartOptions). (Inherited from RSChartPanel.TRSCustomChart.)

protected method

UpdateAxisInfo(TRSChartAxis)

Represents method UpdateAxisInfo(TRSChartAxis). (Overrides RSChartPanel.TRSCustomChart.UpdateAxisInfo(TRSChartAxis).)

protected method

UpdateColorScheme

Updates the values to the current color scheme. If PanelColorScheme is True then uses the Panel's color scheme (Inherited from RSChartPanel.TRSCustomChart.)

protected method

ValueSelectionChanged(TRSChartValue)

Represents method ValueSelectionChanged(TRSChartValue). (Inherited from RSChartPanel.TRSCustomChart.)

protected method

ValueVisibleChanged(TRSChartValue)

Represents method ValueVisibleChanged(TRSChartValue). (Inherited from RSChartPanel.TRSCustomChart.)

protected method

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. (Overrides RSBarCharts.TRSCustomSparseBarChart.WantsCaptions(TRSChartAxis).)

Top

To add a bar to the chart (at Design-Time):

Select the TRSHighLowAverageChart component
 

Click the ellipsis button (...) for the Values property of the chart. This action displays Delphi's Collection Editor for the TRSHighLowAverageChartValues collection.
 

Use the Add button to add bars (TRSHighLowAverageChartValue collection item) to the chart.
 

Edit the X property for the horizontal location of the bar

Edit the High, Low, and Average properties to specify the bar vertically

Optionally, change the BarStyle of the bar chart. This changes all bar shapes. If you want each bar to be an bsImage, you need to assign a TImageList to the ImageList property and define the ImageIndex for each bar.
 

The following code sets up a TRSHighLowAverageChart to display images in the bars and creates a couple of bars:

Delphi

var
   Value: TRSHighLowAverageChartValue;  // note, this type should be the same that the chart uses (e.g., TRS2DChartValue, TRSArrowChartValue, etc)
 begin
   RSHighLowAverageChart1.BarStyle := bsRoundRect;
   RSHighLowAverageChart1.BarSizePct := 75;
 
   // Add first Bar
   Value := RSHighLowAverageChart1.Values.Add;
   Value.X := EncodeDate(2014, 12, 24);
   Value.High := 100;
   Value.Low := 50;
   Value.Average := 80;
   Value.Color := clRed;
 
   // Add second Bar
   Value := RSHighLowAverageChart1.Values.Add;
   Value.X := EncodeDate(2014, 12, 31);
   Value.High := 90;
   Value.Low := 60;
   Value.Average := 68;
   Value.Color := clBlue;
 end;

RiverSoftAVG Products Help © 1996-2016 Thomas G. Grubb