eoinnorris / core-plot

Automatically exported from code.google.com/p/core-plot
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Core Plot graph does not resize sometime #424

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by ajeet.pr...@gmail.com on 9 Apr 2012 at 7:07

GoogleCodeExporter commented 9 years ago
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.

Original comment by eskr...@mac.com on 11 Apr 2012 at 12:39

GoogleCodeExporter commented 9 years ago
This was fixed in issue 281. If you can't update to a newer version of Core 
Plot that includes the fix, look at the revision linked from that issue to see 
what changes you need to make in your copy.

Original comment by eskr...@mac.com on 11 Apr 2012 at 9:47