Skip to main content
All docs
V24.1

TdxChartBarSeriesPointDrawParameters Class

Stores series point draw settings in a Bar series View.

Declaration

TdxChartBarSeriesPointDrawParameters = class(
    TdxChartSeriesPointDrawParameters
)

Remarks

The TdxChartBarSeriesPointDrawParameters class implements only the Appearance property that allows you to change fill and outline settings of individual bars in a Simple, Stacked, or Full-Stacked Bar series.

Handle an XY diagram‘s OnGetSeriesPointDrawParameters event to change the appearance of individual series points based on certain conditions.

Code Example

The following code example demonstrates a diagram’s OnGetSeriesPointDrawParameters event handler that changes the appearance settings of all bars that display peak values in a Simple Bar series.

procedure TMyForm.cdBarGetSeriesPointDrawParameters(Sender: TdxChartCustomDiagram;
  AArgs: TdxChartGetSeriesPointDrawParametersEventArgs);
var
  ABarDrawParameters: TdxChartBarSeriesPointDrawParameters;
  ASeries: TdxChartCustomSeries;
  AIndex: Integer;
begin
  if AArgs.SeriesPoint.Series.Caption = '2020' then
  begin
    if AArgs.DrawParameters.ClassType <> TdxChartBarSeriesPointDrawParameters then Exit;
    ABarDrawParameters := AArgs.DrawParameters as TdxChartBarSeriesPointDrawParameters;
    AIndex := AArgs.SeriesPoint.Index;
    ASeries := AArgs.SeriesPoint.Series;
    if ((AIndex = 0) and (ASeries.Points.Values[AIndex] > ASeries.Points.Values[AIndex + 1])) or
       ((AIndex > 0) and (AIndex < ASeries.Points.Count - 1) and
       (ASeries.Points.Values[AIndex] > ASeries.Points.Values[AIndex + 1]) and
        (ASeries.Points.Values[AIndex] > ASeries.Points.Values[AIndex - 1])) then
    begin
      ABarDrawParameters.Appearance.BeginUpdate;
      ABarDrawParameters.Appearance.FillOptions.Color := TdxAlphaColors.OrangeRed;
      ABarDrawParameters.Appearance.FillOptions.Mode := TdxFillOptionsMode.Hatch;
      ABarDrawParameters.Appearance.FillOptions.HatchStyle := TdxFillOptionsHatchStyle.ForwardDiagonal;
      ABarDrawParameters.Appearance.FillOptions.Color2 := TdxAlphaColors.Teal;
      ABarDrawParameters.Appearance.StrokeOptions.Color := TdxAlphaColors.Red;
      ABarDrawParameters.Appearance.StrokeOptions.Style := TdxStrokeStyle.Solid;
      ABarDrawParameters.Appearance.EndUpdate;
    end;
  end;
end;

VCL Chart Control: Custom Series Points in a Simple Bar View

Indirect TdxChartLineSeriesPointDrawParameters Class Reference

The TdxChartGetSeriesPointDrawParametersEventArgs.DrawParameters property references the TdxChartBarSeriesPointDrawParameters class as a TdxChartSeriesPointDrawParameters object when a diagram’s OnGetSeriesPointDrawParameters event occurs for an XY series with the active Simple, Stacked, or Full-Stacked Bar View.

You need to cast a TdxChartSeriesPointDrawParameters object to the TdxChartBarSeriesPointDrawParameters class to access all draw settings of a series point in a Simple, Stacked, or Full-Stacked Bar series.

Tip

You can call a TdxChartSeriesPointDrawParameters object’s ClassType function within an OnGetSeriesPointDrawParameters event handler to identify the actual point draw series type.

Inheritance

TObject
TdxChartSeriesPointDrawParameters
TdxChartBarSeriesPointDrawParameters
See Also