LabelFormatter
public class LabelFormatterFormats label text using placeholder tokens. Supports placeholders like {value}, {series}, {category}, {percent}, etc.
Properties
Section titled “Properties”
Culture
Section titled “Culture”public CultureInfo Culture { get; set; }Gets or sets the culture used for formatting numbers and dates.
Returns
System.Globalization.CultureInfo — No return description is available.
NumericFormat
Section titled “NumericFormat”public string NumericFormat { get; set; }Gets or sets the default format for numeric values.
Returns
System.String — No return description is available.
PercentFormat
Section titled “PercentFormat”public string PercentFormat { get; set; }Gets or sets the default format for percentage values.
Returns
System.String — No return description is available.
DateFormat
Section titled “DateFormat”public string DateFormat { get; set; }Gets or sets the default format for date values.
Returns
System.String — No return description is available.
Constructors
Section titled “Constructors”
LabelFormatter()
Section titled “LabelFormatter()”public LabelFormatter()Creates a new label formatter with default settings.
LabelFormatter(CultureInfo)
Section titled “LabelFormatter(CultureInfo)”public LabelFormatter(CultureInfo culture)Creates a new label formatter with the specified culture.
Parameters
| Name | Type | Description |
|---|---|---|
culture |
System.Globalization.CultureInfo |
Methods
Section titled “Methods”
Format(string, LabelContext)
Section titled “Format(string, LabelContext)”public string Format(string template, LabelContext context)Formats a label template using the provided context.
Parameters
| Name | Type | Description |
|---|---|---|
template |
System.String | Template string with placeholders. |
context |
ChartGuru.LabelContext | Context providing values for placeholders. |
Returns
System.String — Formatted string with placeholders replaced.
ValueLabel(float, string)
Section titled “ValueLabel(float, string)”public static string ValueLabel(float value, string format = "F1")Creates a simple label showing only the value.
Parameters
| Name | Type | Description |
|---|---|---|
value |
System.Single | |
format |
System.String |
Returns
System.String — No return description is available.
SeriesValueLabel(string, float, string)
Section titled “SeriesValueLabel(string, float, string)”public static string SeriesValueLabel(string seriesName, float value, string format = "F1")Creates a label showing series name and value.
Parameters
| Name | Type | Description |
|---|---|---|
seriesName |
System.String | |
value |
System.Single | |
format |
System.String |
Returns
System.String — No return description is available.
CategoryValueLabel(string, float, string)
Section titled “CategoryValueLabel(string, float, string)”public static string CategoryValueLabel(string category, float value, string format = "F1")Creates a label showing category and value.
Parameters
| Name | Type | Description |
|---|---|---|
category |
System.String | |
value |
System.Single | |
format |
System.String |
Returns
System.String — No return description is available.
PieLabel(string, float, string)
Section titled “PieLabel(string, float, string)”public static string PieLabel(string name, float percent, string format = "F1")Creates a pie/donut label showing name and percentage.
Parameters
| Name | Type | Description |
|---|---|---|
name |
System.String | |
percent |
System.Single | |
format |
System.String |
Returns
System.String — No return description is available.