Back to Devexpress

Hint Class

maui-devexpress-dot-maui-dot-charts-3c8d300b.md

latest8.8 KB
Original Source

Hint Class

Configures hints the the hints the ChartView displays.

Namespace : DevExpress.Maui.Charts

Assembly : DevExpress.Maui.Charts.dll

NuGet Package : DevExpress.Maui.Charts

Declaration

csharp
public class Hint :
    HintBase

The following members return Hint objects:

Remarks

A hint is a small pop-up rectangle that shows information about a tapped series or point. The Chart View can display its hints as Tooltips and as a Crosshair Cursor:

Tooltip

Crosshair Cursor

How to: Enable Hints in the ChartView

The following code modifies the general properties of the hint the ChartView displays:

xml
<dxc:ChartView>
    <dxc:ChartView.Hint>
        <dxc:Hint Enabled="True" 
                  ShowMode="OnTap"/>
    </dxc:ChartView.Hint>
</dxc:ChartView>

The code above utilizes the following properties and classes:

|

Symbol

|

Description

| | --- | --- | |

ChartView.Hint

|

Gets or sets the chart hints. This is a bindable property.

| |

Hint

|

Configures hints the the hints the ChartView displays.

| |

HintBase.Enabled

|

Gets or sets whether the chart displays hints when a user taps chart, and when a hint is requested in code. This is a bindable property.

| |

HintBase.ShowMode

|

Gets or sets a gesture on which the chart shows hints.

|

How to: Change the Hint Behavior

The Hint provides the following behaviors that manage how the chart displays the hint:

Tooltip Behavior

The chart shows the hint as a tooltip:

Note

The Tooltip requests data to display from a series. The series provides the Series.HintOptions property to configure what data the series returns.

The following code configures this hint behavior and manages how the hint interacts with this series:

<dxc:ChartView>
    <dxc:ChartView.Hint>
        <dxc:Hint>
            <dxc:Hint.Behavior>
                <dxc:TooltipHintBehavior/>
            </dxc:Hint.Behavior>
        </dxc:Hint>
    </dxc:ChartView.Hint>
    <dxc:ChartView.Series>
        <dxc:BarSeries>
            <dxc:BarSeries.HintOptions>
                <dxc:SeriesHintOptions PointTextPattern="{}{S}, {A}: {V$0.##}"/>
            </dxc:BarSeries.HintOptions>
        </dxc:BarSeries>
    </dxc:ChartView.Series>
</dxc:ChartView>

The code above utilizes the following classes and properties:

|

Symbols

|

Description

| | --- | --- | |

Hint.Behavior

|

Gets or sets the behavior of the hint. This is a bindable property.

| |

TooltipHintBehavior

|

Defines the tooltip behavior.

| |

Series.HintOptions

|

| |

SeriesHintOptions

|

Stores the series’ tooltip settings.

|

Crosshair Cursor Behavior

The chart shows the hint as the Crosshair Cursor:

Note

The Crosshair Cursor requests data to display from a series and axes. The series provides the Series.HintOptions property to configure what data the series returns. The AxisBase.HintOptions property manages how the hint interacts with the axis.

The following code configures this hint behavior and manages how the hint interacts with the series and axes:

xml
<dxc:ChartView>
    <dxc:ChartView.Hint>
        <dxc:Hint>
            <dxc:Hint.Behavior>
                <dxc:CrosshairHintBehavior GroupHeaderTextVisible="False"/>
            </dxc:Hint.Behavior>
        </dxc:Hint>
    </dxc:ChartView.Hint>
    <dxc:ChartView.AxisY>
        <dxc:NumericAxisY>
            <dxc:NumericAxisY.HintOptions>
                <dxc:AxisHintOptions LineVisible="False" LabelVisible="False"/>
            </dxc:NumericAxisY.HintOptions>
        </dxc:NumericAxisY>
    </dxc:ChartView.AxisY>
    <dxc:ChartView.Series>
        <dxc:BarSeries>
            <dxc:BarSeries.HintOptions>
                <dxc:SeriesCrosshairOptions PointTextPattern="{}{S}, {A}: {V$0.##}"/>
            </dxc:BarSeries.HintOptions>
        </dxc:BarSeries>
    </dxc:ChartView.Series>
</dxc:ChartView>

The markup above uses the classes and properties below:

|

Symbols

|

Description

| | --- | --- | |

Hint.Behavior

|

Gets or sets the behavior of the hint. This is a bindable property.

| |

CrosshairHintBehavior

|

Defines the crosshair hint behavior.

| |

Series.HintOptions

|

| |

SeriesCrosshairOptions

|

Stores the series’ crosshair cursor settings.

| |

AxisBase.HintOptions

|

Gets or sets an object that configures how the axis interacts with the Hint. This is a bindable property.

| |

AxisHintOptions

|

Stores settings that specify how the axis interacts with the crosshair cursor.

|

How to: Customize the Hint Appearance

The Hint.Style manages the hint appearance. The style configures the following hint elements:

|

Hint Element

|

Property

|

Description

| | --- | --- | --- | |

1. Hint Label

|

BackgroundColor

|

Gets or sets the hint label’s background color. This is a bindable property.

| | |

ItemsIndent

|

Gets or sets the indent between crosshair hint label items. This is a bindable property.

| | |

MarkerSize

|

Gets or sets the hint’s marker size. This is a bindable property.

| | |

Padding

|

Gets or sets the hint’s label padding. This is a bindable property.

| | |

TextIndent

|

Gets or sets the indent between a hint marker and text. This is a bindable property.

| |

2. Argument Line

|

ArgumentLineStyle

|

Gets or sets the options that configure the argument line appearance for the crosshair hint. This is a bindable property.

| |

3. Value Line

|

ValueLineStyle

|

Gets or sets the options that configure the value line appearance for the crosshair hint. This is a bindable property.

|

Implements

IElementController

INotifyPropertyChanged

Inheritance

System.Object BindableObject Element ChartElementBase ChartElement StyledElement HintBase Hint

Extension Methods

Yield<Hint>()

YieldIfNotNull<Hint>()

See Also

Hint Members

DevExpress.Maui.Charts Namespace