Table of Contents

TTMSFNCDistributionValues Class

Ordered collection of distribution data points. Provides typed access to the items, helpers to compute each item's share of the combined total, sorting by descending value, and a change notification used to trigger a repaint of the owning control.

API unit family: TMSFNCWidgetDistributionIndicator Inherits from: TOwnedCollection

Syntax

TTMSFNCDistributionValues = class(TOwnedCollection)

Properties

Name Description
AbsoluteTotal Cached combined total of all item values, used to derive each item's percentage share. Maintained internally and recomputed on demand.
Items Provides indexed access to the data points in the collection. This is the default property, so the collection can be indexed directly.

Methods

Name Description
Add Appends a new data point to the end of the collection.
Delete Removes the data point at the specified position.
GetPercentOfAbsoluteTotal Returns the item's value expressed as a percentage of the combined total of all items. The running totals are recomputed automatically when the cached total is stale.
Insert Inserts a new data point at the specified position.
QuickSort Sorts the items in place by descending value using a recursive quicksort over the inclusive index range.
SetupRunningTotal Recomputes the cumulative running total of every item in order and refreshes the cached combined total used for percentage calculations.

Events

Name Description
OnChanged Occurs after any item or the collection itself changes. The owning control handles this to repaint. Sender is the collection.