muthusabarinathan / core-plot

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

Graph resize issue on window or split view resize #574

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Need to have an app with Split view
2. Split view should have Tab view inside it (in my case second view of split 
view)
3. All tabs of Tab view (in my case three tabs) have graphs inside them

What is the expected output? What do you see instead?
When NSSPlit view or Window is resized all graphs should also resize (not only 
currently visible Graph)

What version of the product are you using? On what operating system?
Have tried with v1.1 and v1.3 and same issue. However older version of the 
framework does not have any such issue. I am using OS X 10.8.4 and have 
verified on 10.7.4/10.9 as well.

Please provide any additional information below.
1) Currently visible graph resizes properly but graphs those are not visible 
(inside other tabs) does not resize).
2) I have Auto resize subview property checked for all parent views of graphs
3) Also noticed if graph does not have any Plot added to it then it resize 
properly
4) Please refer the screen shots

Original issue reported on code.google.com by apo...@gmail.com on 27 Aug 2013 at 3:32

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by eskr...@mac.com on 29 Aug 2013 at 12:31

GoogleCodeExporter commented 8 years ago
Is  there any workaround for this issue or any patch fix?

Original comment by apo...@gmail.com on 29 Aug 2013 at 3:17

GoogleCodeExporter commented 8 years ago
I haven't had time to look at it in detail yet. Did you do a clean build after 
switching Core Plot versions? Some older versions had layout issues that should 
be fixed in 1.3 that might cause similar symptoms.

Original comment by eskr...@mac.com on 29 Aug 2013 at 11:18

GoogleCodeExporter commented 8 years ago
Tried with latest v1.3 and still an issue.

Original comment by apo...@gmail.com on 30 Aug 2013 at 3:19

GoogleCodeExporter commented 8 years ago
Using the latest code (default branch in the Mercurial repository) and the 1.3 
release, I am unable to reproduce this issue.

Can you provide a small sample project that demonstrates the problem?

Original comment by eskr...@mac.com on 2 Sep 2013 at 1:31

GoogleCodeExporter commented 8 years ago
I have created a sample project but it is is also not showing any such issue so 
seems like something is wrong with my project. I have compared properties of 
all view one by one but no difference but it is not working. Any idea?

Original comment by apo...@gmail.com on 5 Sep 2013 at 5:44

GoogleCodeExporter commented 8 years ago
Are there any other views in your app that may be changing the layout 
calculations?

Original comment by eskr...@mac.com on 5 Sep 2013 at 11:12

GoogleCodeExporter commented 8 years ago
Sorry, was not able to respond. 

None of the controller or view is calculating size programatically. I tried to 
implement on tab switch to resize CPTGraphHost and CPTXYGraph to new size but 
did not work. What i observed is that GraphHostView did resize but CPTXYGraph 
does not resize. 

Original comment by apo...@gmail.com on 16 Sep 2013 at 2:30

GoogleCodeExporter commented 8 years ago
Is this happening on the app running on iOS7? Because I am seeing the same 
issue on iOS7 where the graphView is not resizing to the view's bounds to which 
I set its frame to (graphView.frame = cell.contentView.bounds and then add the 
graphView as a subview to the cell's contentView). I have the cell's content 
view set to autoresize subviews.

Original comment by vake...@gmail.com on 16 Sep 2013 at 2:59

GoogleCodeExporter commented 8 years ago
Sorry app is for OS X.  I have verified the issue on 10.7.x/10.8.x and 10.9 as 
well using coreplot 1.1/1.2 and 1.3 but same issue.

Original comment by apo...@gmail.com on 16 Sep 2013 at 3:50

GoogleCodeExporter commented 8 years ago
Hi Eskroch,

As you suggested to create a sample project to replicate the issue and i did 
created but it was working fine. Only different i see between my project and 
demo project is autosizing properties of tab views.  View hierarchy of both 
project is same and it is like (Main window -> tab view->sub classed tab item 
-> tab items' view (autosizing mask for flexible width and height are not 
selected and disabled automatically) -> custom view ->spit view->second 
splitter -> NSTabView.

The last tab view has four tabs and each tab have a graph. View of each tab 
item is representing CPTGraphHostingView. The last tab set's auto sizing mask 
for width and height are disabled and not selected where as in my demo project 
these are selected (though disabled).

And I think it is causing graph resize issue. I tried to set autoresizing mask 
inside the awakeFromNib method of tabset but it is not working. I hope now you 
can help me. Refer the screen shot for more details.

Thanks.

Original comment by apo...@gmail.com on 18 Sep 2013 at 10:24

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by eskr...@mac.com on 11 Oct 2013 at 12:27

GoogleCodeExporter commented 8 years ago
Erik, 

i agree that's its invalid but i still can't get it working. I have also tried 
to set the new frame for Hosting view and graph but no luck.  Any more ideas?. 
I have invoked below method when tab is selected and setting new size for graph.

-(void) updateGraphBounds:(NSRect)newBound{

    CGRect newRect = CGRectMake(self.graphHost.hostedGraph.frame.origin.x, self.graphHost.hostedGraph.frame.origin.y, self.graphHost.frame.size.width, self.graphHost.frame.size.height);
    self.graphHost.hostedGraph.frame = newRect;//NSRectToCGRect([self.graphHost frame]);
    [self.graphHost.hostedGraph setNeedsDisplay];
    self.graphHost.hostedGraph.graph.frame = newRect;
    [self.graphHost.hostedGraph.graph setNeedsDisplay];

}

Original comment by apo...@gmail.com on 11 Oct 2013 at 12:58

GoogleCodeExporter commented 8 years ago
Changing the size of the hosting view will automatically set the size of the 
graph layer and all other parts of the graph. There's something about the way 
your views are set up in the main app that is interfering with the view layout. 
I don't know what it is.

We need to take this discussion off the issue tracker. You can ask on the Core 
Plot discussion board 
(https://groups.google.com/forum/#!forum/coreplot-discuss), but I think this is 
a general view layout question better suited for a site like stackoverflow.com, 
though.

Original comment by eskr...@mac.com on 11 Oct 2013 at 11:42

GoogleCodeExporter commented 8 years ago
Thanks for your response. I have already a questions open on stackoverflow 
(http://stackoverflow.com/questions/18870225/nstabview-inside-nssplitview-and-au
tosizing-mask-causing-core-plot-graphs-to-n) and you did reply on that but no 
other help.  Thanks anyway and if you have any more clue then please respond on 
stackoverflow.

Original comment by apo...@gmail.com on 11 Oct 2013 at 11:47