Page 1 of 1
TeeCHart Display problem for Xamarin.iOS
Posted: Wed Apr 09, 2014 9:46 pm
by 17366988
I'm having a problem with the generated chart because it is always misplaced (see attachement). My project is locked at landscape view and still it is not properly displayed. I use a "UIImageView" object to reference as a frame and also the chart is added as a subview (or View in some test).
In the attachement, the chart should be a little underneath and beside the buttons and throughout the remaining spaces. Also, I'm using an iPhone 3gs as a test device.
Re: TeeCHart Display problem for Xamarin.iOS
Posted: Fri Apr 11, 2014 2:20 pm
by Pep
Hello,
please take a look at the TeeChartBuilder example (which is included within the installer) code. There you can find a way to fix where the chart is placed, once the device is rotated, basically :
Code: Select all
public override void ViewDidAppear (bool animated)
{
UIDevice.CurrentDevice.BeginGeneratingDeviceOrientationNotifications();
CheckPositions ();
}
public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations ()
{
return base.GetSupportedInterfaceOrientations ();
}
private void DeviceRotated(NSNotification notification)
{
CheckPositions();
}
public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
{
CheckPositions ();
}
private void CheckPositions()
{
// Refresh Chart rotating the device
chart.RemoveFromSuperview ();
RectangleF f = new RectangleF(View.Frame.X,50,View.Frame.Width,View.Frame.Height-BottomBar.Frame.Height-50);
chart.Frame = f;
View.AddSubview (chart);
chart.DoInvalidate ();
BottomBar.Frame = new RectangleF (0,View.Frame.Height-50,
this.chart.Frame.Width,50);
}
Re: TeeCHart Display problem for Xamarin.iOS
Posted: Sat Apr 12, 2014 1:03 pm
by 17366988
Actually the supported view of my app is just "Landscape" view as I'm having a hard time dealing with the orientation. Nevertheless even if the app only supports one orientation, the chart generated by TeeChart is still misplaced.
Re: TeeCHart Display problem for Xamarin.iOS
Posted: Tue Apr 15, 2014 8:52 am
by Pep
Hello,
so, if I understand, you need to open a new View, in landscape mode and be able to show the Chart as a client or at specific position, isn't it ?
I'm asking to you in order to prepare a code that does that.
Re: TeeCHart Display problem for Xamarin.iOS
Posted: Wed Apr 16, 2014 3:36 am
by 17366988
Hello,
so, if I understand, you need to open a new View, in landscape mode and be able to show the Chart as a client or at specific position, isn't it ?
I'm asking to you in order to prepare a code that does that.
No Sir, I have no problem in the orientation since I set it to only support lanscape mode. The chart is misplaced
Re: TeeCHart Display problem for Xamarin.iOS
Posted: Wed Apr 16, 2014 8:35 am
by Pep
Hello,
ok, would you be so kind to post here the lines of code that shows how you're adding the Chart to the View (or into the UIImageView) ? You should take the ImageView Frame as reference to set the TChart frame.