Version

LabelHash Property (UltraChart)

Sets or gets the hash table for the chart's custom labels.
Syntax
'Declaration
 
Public Property LabelHash As Hashtable
public Hashtable LabelHash {get; set;}
Example
UltraChart1.Tooltips.Format = TooltipStyle.Custom
UltraChart1.Tooltips.FormatString = "<MY_VALUE>"
Dim MyLabelHashTable as New Hashtable
MyLabelHashTable.Add("MY_VALUE", New MyLabelRenderer)
UltraChart1.LabelHash = MyLabelHashTable

' ... 

Public Class MyLabelRenderer
	Implements IRenderLabel
	Public OverLoads Function ToString(ByVal Context As Hashtable) As String Implements IRenderLabel.ToString
		Select Case CDbl(Context("DATA_VALUE"))
			Case Is > 1000
				Return CStr(Context("DATA_VALUE")) & " [Very High]"
			Case Is > 100
				Return CStr(Context("DATA_VALUE")) & " [High]"
			Case Is > 10
				Return CStr(Context("DATA_VALUE")) & " [Medium]"
			Case Is >= 0
				Return CStr(Context("DATA_VALUE")) & " [Low]"
			Case Else
				Return CStr(Context("DATA_VALUE")) & " [Negative]"
		End Select
	End Function
End Class
UltraChart1.Tooltips.Format = TooltipStyle.Custom;
UltraChart1.Tooltips.FormatString = "<MY_VALUE>";
Hashtable MyLabelHashTable = new Hashtable();
MyLabelHashTable.Add("MY_VALUE", new MyLabelRenderer());
UltraChart1.LabelHash = MyLabelHashTable;

// ... 

public class MyLabelRenderer : IRenderLabel
{
	public string ToString(Hashtable Context)
	{
		double dataValue = (double)Context["DATA_VALUE"];
		if (dataValue > 1000)
			return (string)Context["DATA_VALUE"] + " [Very High]";
		else if (dataValue > 100)
			return (string)Context["DATA_VALUE"] + " [High]";
		else if (dataValue > 10)
			return (string)Context["DATA_VALUE"] + " [Medium]";
		else if (dataValue >= 0)
			return (string)Context["DATA_VALUE"] + " [Low]";
		else		
			return (string)Context["DATA_VALUE"] + " [Negative]";
	}
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also