Class ChartTooltipBehavior
This class is used to customize the appearance of tooltip in SfChart. An instance of this class need to be added to ChartBehaviors collection.
Inherited Members
Namespace: Syncfusion.SfChart.XForms
Assembly: Syncfusion.SfChart.XForms.dll
Syntax
public class ChartTooltipBehavior : ChartBehavior, IThemeElementRemarks
Tooltip is displayed when you tap on a data point. By default, it displays dependent values of data point. For example, for column series, it displays y values, and for financial series, it displays open, high, low and close values.
Examples
SfChart chart = new SfChart();
ChartTooltipBehavior tooltip = new ChartTooltipBehavior();
chart.ChartBehaviors.Add(tooltip);Constructors
ChartTooltipBehavior()
Initializes a new instance of the ChartTooltipBehavior class.
Declaration
public ChartTooltipBehavior()Fields
BackgroundColorProperty
Gets or sets the tooltip background color. This is a bindable property.
Declaration
public static readonly BindableProperty BackgroundColorPropertyField Value
| Type | 
|---|
| Xamarin.Forms.BindableProperty | 
BorderColorProperty
Gets or sets the border stroke color of the tooltip. This is a bindable property.
Declaration
public static readonly BindableProperty BorderColorPropertyField Value
| Type | 
|---|
| Xamarin.Forms.BindableProperty | 
BorderWidthProperty
Gets or sets the width of the tooltip border line. This is a bindable property.
Declaration
public static readonly BindableProperty BorderWidthPropertyField Value
| Type | 
|---|
| Xamarin.Forms.BindableProperty | 
DurationProperty
Gets or sets the duration of the tooltip text in seconds. This is a bindable property.
Declaration
public static readonly BindableProperty DurationPropertyField Value
| Type | 
|---|
| Xamarin.Forms.BindableProperty | 
FontAttributesProperty
Gets or sets the font style for the tooltip text. This is a bindable property.
Declaration
public static readonly BindableProperty FontAttributesPropertyField Value
| Type | 
|---|
| Xamarin.Forms.BindableProperty | 
FontFamilyProperty
Gets or sets the font family name for the tooltip text. This is a bindable property.
Declaration
public static readonly BindableProperty FontFamilyPropertyField Value
| Type | 
|---|
| Xamarin.Forms.BindableProperty | 
FontProperty
Gets or sets the Font for the tooltip text. This is a bindable property.
Declaration
public static readonly BindableProperty FontPropertyField Value
| Type | 
|---|
| Xamarin.Forms.BindableProperty | 
FontSizeProperty
Gets or sets the font size for the tooltip text. This is a bindable property.
Declaration
public static readonly BindableProperty FontSizePropertyField Value
| Type | 
|---|
| Xamarin.Forms.BindableProperty | 
LabelFormatProperty
Gets or sets the label format for the tooltip label. This is a bindable property.
Declaration
public static readonly BindableProperty LabelFormatPropertyField Value
| Type | 
|---|
| Xamarin.Forms.BindableProperty | 
MarginProperty
Gets or sets the margin of the tooltip text. This is a bindable property.
Declaration
public static readonly BindableProperty MarginPropertyField Value
| Type | 
|---|
| Xamarin.Forms.BindableProperty | 
OffsetXProperty
Gets or sets the horizontal offset of the tooltip. This is a bindable property.
Declaration
public static readonly BindableProperty OffsetXPropertyField Value
| Type | 
|---|
| Xamarin.Forms.BindableProperty | 
OffsetYProperty
Gets or sets the vertical offset of the tooltip. This is a bindable property.
Declaration
public static readonly BindableProperty OffsetYPropertyField Value
| Type | 
|---|
| Xamarin.Forms.BindableProperty | 
TextColorProperty
Gets or sets the color for the text of the tooltip. This is a bindable property.
Declaration
public static readonly BindableProperty TextColorPropertyField Value
| Type | 
|---|
| Xamarin.Forms.BindableProperty | 
Properties
BackgroundColor
Gets or sets the tooltip background color. This is a bindable property.
Declaration
public Color BackgroundColor { get; set; }Property Value
| Type | Description | 
|---|---|
| Xamarin.Forms.Color | This property takes the Xamarin.Forms.Color value. | 
BorderColor
Gets or sets the border stroke color of the tooltip. This is a bindable property.
Declaration
public Color BorderColor { get; set; }Property Value
| Type | Description | 
|---|---|
| Xamarin.Forms.Color | This property takes the Xamarin.Forms.Color value. | 
BorderWidth
Gets or sets the width of the tooltip border line. This is a bindable property.
Declaration
public double BorderWidth { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Double | This property takes the System.Double value. | 
Duration
Gets or sets the duration of the tooltip text in seconds. This is a bindable property.
Declaration
public double Duration { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Double | This property takes double value in second format. | 
Font
Gets or sets the Font for the tooltip text. This is a bindable property.
Declaration
public Font Font { get; set; }Property Value
| Type | Description | 
|---|---|
| Xamarin.Forms.Font | This property takes the Font value. | 
FontAttributes
Gets or sets the font style for the tooltip text. This is a bindable property.
Declaration
public FontAttributes FontAttributes { get; set; }Property Value
| Type | 
|---|
| Xamarin.Forms.FontAttributes | 
FontFamily
Gets or sets the font family name for the tooltip text. This is a bindable property.
Declaration
public string FontFamily { get; set; }Property Value
| Type | 
|---|
| System.String | 
FontSize
Gets or sets the font size for the tooltip text. This is a bindable property.
Declaration
public float FontSize { get; set; }Property Value
| Type | 
|---|
| System.Single | 
LabelFormat
Gets or sets the label format for the tooltip label. This is a bindable property.
Declaration
public string LabelFormat { get; set; }Property Value
| Type | Description | 
|---|---|
| System.String | This property take the string value. | 
Margin
Gets or sets the margin of the tooltip text. This is a bindable property.
Declaration
public Thickness Margin { get; set; }Property Value
| Type | Description | 
|---|---|
| Xamarin.Forms.Thickness | This property takes the Xamarin.Forms.Thickness value. | 
OffsetX
Gets or sets the horizontal offset of the tooltip. This is a bindable property.
Declaration
public double OffsetX { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Double | This property takes double value. | 
OffsetY
Gets or sets the vertical offset of the tooltip. This is a bindable property.
Declaration
public double OffsetY { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Double | This property takes double value. | 
TextColor
Gets or sets the color for the text of the tooltip. This is a bindable property.
Declaration
public Color TextColor { get; set; }Property Value
| Type | Description | 
|---|---|
| Xamarin.Forms.Color | This property takes the Xamarin.Forms.Color value. | 
Methods
Hide(Boolean)
Hides the tooltip view.
Declaration
public void Hide(bool animated)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Boolean | animated | Takes bool value to whether animate or not. | 
Remarks
This method works only in Android and iOS platforms.
Show(Single, Single, Boolean)
Shows the tooltip view at nearest datapoint for given x and y value.
Declaration
public void Show(float pointX, float pointY, bool animated)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Single | pointX | point x. | 
| System.Single | pointY | point y. | 
| System.Boolean | animated | Takes bool value to whether animate or not.. | 
Remarks
This method works only in Android and iOS platforms.