Back to Devexpress

DataSourceKey Class

mobilecontrols-devexpress-dot-xamarinforms-dot-charts-6d600b9f.md

latest2.2 KB
Original Source

DataSourceKey Class

Provides access to an object that specifies an item of the data source to which the chart is bound.

Namespace : DevExpress.XamarinForms.Charts

Assembly : DevExpress.XamarinForms.Charts.dll

NuGet Package : DevExpress.XamarinForms.Charts

Declaration

csharp
public class DataSourceKey

Remarks

Use the DataSourceKey object when you handle the SelectionChanged or HintShown event. Its DataObject and Index properties return an object that specifies a data source’s item to which the processed series point corresponds and this item’s index in the data source.

Example

In this example, a hint with preset options appears when a user taps a bubble.

  1. Use the FilmData object collection as the data source for the chart to show the highest grossing films as bubbles.

  2. Subscribe to the SelectionChanged event and enable hints for the chart.

  3. In the event handler, use the DataSourceKey.DataObject property to access an object that corresponds with the selected bubble and cast it to the type of the data source object ( FilmData ). Call the ShowHint method to show a hint for the selected bubble and specify the tooltip text pattern.

Inheritance

Object DataSourceKey

See Also

DataSourceKey Members

DevExpress.XamarinForms.Charts Namespace