Search Framework:
DataPanelItem
Namespace: WealthLab.Backtest
Parent: Object

The DataPanelItem class contains the information displayed in a row of the WL9 Data Panel. If you are building a Data Panel ScoreCard Extension, create DataPanelItem instances and add them to the List returned by its GetItems method.

Constructors
DataPanelItem
public DataPanelItem()
public DataPanelItem(string header, string stringValue)
public DataPanelItem(string header, double numberValue, int? dec = null, bool colorize = false, string suffix = null)
public DataPanelItem(string header, double numberValue, WLColor color)

DataPanelItem provides several constructors for creating Data Panel rows. The parameterless constructor creates an uninitialized instance. Use the second constructor for an item containing a string value. Use the third constructor for a numeric value, optionally specifying the number of decimal places, whether the value should be colorized based on its sign, and a suffix. Use the fourth constructor for a numeric value with an explicitly assigned WLColor.



Properties
Color
public WLColor Color

Contains an optional color override to use when rendering the item in the Data Panel. The default value is null.


Colorize
public bool Colorize

Determines whether the item should be colorized based on its NumberValue. When true, positive and negative values can be rendered using the Data Panel's corresponding profit and loss colors. The default value is false.


Decimals
public int? Decimals

Contains an optional override for the number of decimal places used when formatting NumberValue. If null, DisplayValue determines the number of decimal places automatically.


DisplayValue
public string DisplayValue

Returns the formatted value to display in the Data Panel. If StringValue is not null, it is returned directly. Otherwise, NumberValue is formatted using an automatically determined number of decimal places, with a minimum of two decimal places. If Decimals is assigned, it overrides the automatically determined precision. If Suffix is not null, it is appended to the formatted numeric value.


public string Header

Contains the header text displayed in the Item column of the Data Panel.


NumberValue
public double NumberValue

Contains the numeric value of the item. DisplayValue uses this value when StringValue is null.


StringValue
public string StringValue

Contains an optional string value for the item. If it is not null, DisplayValue returns this value instead of formatting NumberValue.


Suffix
public string Suffix

Contains an optional string appended to the formatted NumberValue when calculating DisplayValue. For example, you can assign "%" to display a numeric value with a percent suffix.