private void Sunburst_Tapped(object sender, C1.Android.Core.C1TappedEventArgs e) { C1Point p = e.GetPosition(sunburst); ChartHitTestInfo hitTestInfo = this.sunburst.HitTest(p); if (_view != null) { _view.Visibility = ViewStates.Invisible; } if (hitTestInfo == null || hitTestInfo.Item == null) { return; } if (hitTestInfo.Item is IChartModel) { View view = ((IChartModel)hitTestInfo.Item).GetUserView(this); _view = view; Rect myViewRect = new Rect(); sunburst.GetGlobalVisibleRect(myViewRect); double length = myViewRect.Width() < myViewRect.Height() ? myViewRect.Width() : myViewRect.Height(); length = length * sunburst.InnerRadius / 1.2; // 1.2 is proper size between 1 and 1.414(Math.Sqrt(2)); int x = (int)(myViewRect.CenterX() - length / 2); int y = (int)(myViewRect.CenterY() - length); if (view.Parent != null) { ((ViewGroup)view.Parent).RemoveView(view); } if (view.Parent == null) { ViewGroup.LayoutParams para = new ViewGroup.LayoutParams((int)length, (int)length); sunburst.AddView(view, para); } _view.SetX((int)(x + sunburst.TranslationX)); _view.SetY((int)(y + sunburst.TranslationY)); _view.ScaleX = (float)sunburst.Scale; _view.ScaleY = (float)sunburst.Scale; _view.Visibility = ViewStates.Visible; _x = x; _y = y; _width = _height = length; } }