gujjula / core-plot

Automatically exported from code.google.com/p/core-plot
0 stars 0 forks source link

Padding decrease causes a plot cutting-off #258

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
# What steps will reproduce the problem?
1. Take the CPTestApp-iPhone
2. Add a button and a method to decrease the plotAreaFrame.paddingLeft of the 
barChart to e.g. 40.0
3. See what's happening

# What is the expected output? What do you see instead?
I would expect the graph to be extended to the left. This is happening but the 
plot area is cutted off (one and another half bars of the bar plot on the very 
right side don't show up any more).

# What version of the product are you using? On what operating system?
0.2.2 / Xcode 3.2.5

Is there a special setting or treatment to prevent this behaviour?

Original issue reported on code.google.com by bernhard...@gmail.com on 14 Feb 2011 at 6:53

Attachments:

GoogleCodeExporter commented 9 years ago
The plot area is the space in which data can appear. You cannot draw outside of 
it. 
If you need space at the edges, extend the coordinate range (x) of your plot 
space.

Drew

Original comment by drewmcco...@mac.com on 14 Feb 2011 at 8:47

GoogleCodeExporter commented 9 years ago
Hi Drew, thanks for the response.

Maybe I should explain my goal exactly - what I want to achieve is the 
following:

I have a bar plot which shows data with values reaching from 0 to 10. These 
values change, so it could be that the values then reach from 1000 to 10000. At 
this point I do have the problem, that the y axis labes don't have enough space 
because the text is longer than before. Therefore I have to decrease or 
increase the paddingLeft of the plotAreaFrame. So all I wanna have is more 
space for the y axis labels.

How should I handle this?

Bernhard

Original comment by bernhard...@gmail.com on 14 Feb 2011 at 2:30

GoogleCodeExporter commented 9 years ago
Ah, I see now. You should set the padding on the graph, not the plot area frame.

Drew

Original comment by drewmcco...@mac.com on 14 Feb 2011 at 3:07

GoogleCodeExporter commented 9 years ago
Hm, I tried this but it doesn't seem to work for me. Setting the (left) padding 
of the graph causes the whole graph to show up a bit more right, letting a 
blank space on the left side. But it doesn't give the y axis more space!

Once again: I would like to give the y axis more space, so that i can put the 
title of the axis a bit more on the left side.

Bernhard

Original comment by bernhard...@gmail.com on 15 Feb 2011 at 7:23

GoogleCodeExporter commented 9 years ago
I still think what is happening here is that the bars are spreading a bit, 
because you are broadening the plot space, and this just happens to push the 
last bar off the plot. You could made the bars narrower, or you could set the x 
range of the plot space to be, say 10% wider than you need for the bars. This 
will pull them well into range.

Drew

Original comment by drewmcco...@mac.com on 15 Feb 2011 at 8:35

GoogleCodeExporter commented 9 years ago
I now found out that this problem depends somehow on the initial setting of 
plotAreaFrame.paddingLeft. I think the initial value must be as low as (or even 
lower than) the lowest value assigned later to this property. If I set it to be 
0 at startup the problem seems to be gone.

If you want to I can send you the modified sample project - I still think it's 
somehow a bug of core plot, or at least a unwished behaviour.

Bernhard

Original comment by bernhard...@gmail.com on 15 Feb 2011 at 12:57

GoogleCodeExporter commented 9 years ago
Hmm, yes that sounds like it is a bug. Something is not being laid out properly 
when the padding is set. Thanks for reporting it. I will reopen the issue.

Original comment by drewmcco...@mac.com on 15 Feb 2011 at 1:35

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 41f3f9bf6c.

Original comment by eskr...@mac.com on 22 Feb 2011 at 1:03

GoogleCodeExporter commented 9 years ago
Unfortunately this solution doesn't work for me. Are there any other changes to 
make than reported in revision 41f3f9bf6c? I currently tested this issue using 
the core plot releases 0.2 and 0.2.2, having the "layoutSublayers" method 
updated. Thereby I found out that this method is not being called when I change 
the padding of the plot area frame. Also a manual call does not do the trick.

Bernhard

Original comment by bernhard...@gmail.com on 2 Mar 2011 at 8:46

GoogleCodeExporter commented 9 years ago
As the solution didn't work for me, I now figured out that updating the 
plotGroup's bounds somehow updates the plot area and so fixes my issue.

Decreasing the plotAreaFrame.paddingLeft without updating the plotGroup.bounds 
still cuts off some pixels of the plot area. For me it doesn't matter to which 
size the plotGroup.bounds is set - but adding this call the whole plot area is 
getting updated and afterwards shown as I would expect it.

Maybe someone could check the problem again, I still think it's a core plot bug.

Bernhard

Original comment by bernhard...@gmail.com on 7 Jun 2011 at 12:35

GoogleCodeExporter commented 9 years ago

Original comment by eskr...@mac.com on 7 Jun 2011 at 10:53

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 549b21ffaacd.

Original comment by eskr...@mac.com on 10 Jul 2011 at 12:51

GoogleCodeExporter commented 9 years ago
issued again with CorePlot 1.1 and 1.2

graph.plotAreaFrame.paddingRight = cond1 > 0 ? 50 : 10;
graph.plotAreaFrame.paddingLeft = cond2 ? 10 : 50;

in ios6 all ok, but in ios5 i had to make calls:

        CPTPlotArea *plotArea = graph.plotAreaFrame.plotArea;
        plotArea.frame = graph.bounds;
        CPTPlotGroup *plotGroup = graph.plotAreaFrame.plotGroup;
        plotGroup.frame = graph.bounds;

        [plotArea layoutSublayers];
        [plotGroup layoutSublayers];

Original comment by dark.storoj@gmail.com on 4 May 2013 at 8:35

GoogleCodeExporter commented 9 years ago
Unable to reproduce.

This issue is closed. Please open a new issue and provide more details and/or 
sample code that demonstrates the problem.

Original comment by eskr...@mac.com on 5 May 2013 at 6:08