I have created a graph using core plot.
Graph is shown in on the screen perfectly.
i have a full screen button on tap on it a popOver shows the graph in a bigger frame…
The problem is that when i resize the graph sometime it does not resize..
If i dismiss the popover I can still see a big char on my screen. This does not happen all the time.
in my .h file
CPGraphHostingView *scatterPlotView;
CPXYGraph *graph, *barChart;
in my .m file
I have created the chart and now on the ful screen button click.
-(void)fullviewpressed:(id)sender
{
UIViewController* popoverContent = [[UIViewController alloc]
init];
UIView* popoverView = [[UIView alloc]
initWithFrame:CGRectMake(0, 212, 1024, 480)];
if(!UIInterfaceOrientationIsLandscape(self.interfaceOrientation))
popoverView.frame = CGRectMake(0, 212, 768, 700);
popoverView.backgroundColor = [UIColor blackColor];
popoverContent.view = popoverView;
//resize the popover view shown
//in the current view to the view's size
popoverContent.contentSizeForViewInPopover = CGSizeMake(980, 460);
if(!UIInterfaceOrientationIsLandscape(self.interfaceOrientation))
popoverContent.contentSizeForViewInPopover = CGSizeMake(768-40, 660);
//create a popover controller
UIPopoverController * popoverController21 = [[UIPopoverController alloc]initWithContentViewController:popoverContent];
self.popoverController = popoverController21;
[popoverController21 release];
self.popoverController.delegate = self;
CGRect btnRct = fullViewBtn.frame;
btnRct.origin.y+=20;
//present the popover view non-modal with a
//refrence to the button pressed within the current view
[self.popoverController presentPopoverFromRect:btnRct
inView:self.view
permittedArrowDirections: UIPopoverArrowDirectionUp
animated:YES];
if(UIInterfaceOrientationIsLandscape(self.interfaceOrientation))
scatterPlotView.frame = CGRectMake(5, 10, 980, 460);
else
scatterPlotView.frame = CGRectMake(5, 10, 768-40, 660);
[popoverView addSubview:scatterPlotView];
[touchView removeFromSuperview];
touchView.frame =scatterPlotView.frame;
[popoverView addSubview:touchView];
//release the popover content
[popoverView release];
[popoverContent release];
}
}
Here touchView is the object of UIView used to add annotation when user taps on the chart.
In short I am just changing the frame of my CPGraphHostingView.
but why it does not resize sometimes.
What version of Core Plot are you using? Based on the “CP” class prefix in your code, I suspect it’s pretty old. An update to a newer version might solve this problem for you.