Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
142982 | Feb 27,2019 02:16 PM UTC | Mar 1,2019 07:11 AM UTC | Xamarin.Android | 3 |
![]() |
Tags: SfChart |
chart.SelectionChanged += chart_SelectionChanged
The aim of this call is to show a bespoke tooltip. Unfortunately when the event is triggered, ((SfChart.SelectionChangedEventArgs) e).P1.SelectedSegment is set to null and therefore I can't access its X1 and Y1 properties to determine where to place the tooltip (e.P1 is otherwise populated correctly/as expected). This isn't an issue when working with a SplineSeries.
Any guidance is most appreciated.
private void Chart_SelectionChanged(object sender, SfChart.SelectionChangedEventArgs e)
{
var currentIndex = e.P1.SelectedDataPointIndex;
var items = e.P1.SelectedSeries.ItemsSource;
var data = items as ObservableCollection<Model1>;
if (data != null)
{
var yVal = data[currentIndex].YValue;
var xVal = data[currentIndex].XValue;
var X1 = e.P0.PrimaryAxis.ValueToPoint(xVal); //Here can get the X1 value
var Y1 = e.P0.SecondaryAxis.ValueToPoint(yVal); //Here can get the Y1 value
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.