gujjula / core-plot

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

Stacked Bars with negative values displays not correct. #218

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create Stacked Bar.
2. Set negative values for stacked bar.
3. Set negative location for range (if this a vertical bar - yRange).

What is the expected output? What do you see instead?
I want to see normal bar.
Instead, i see offsets between stacks in bar.

What version of the product are you using? On what operating system?

Please provide any additional information below.
Setup range:

 barPlotSpace.yRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(-100) length:CPDecimalFromFloat(1000.0f)];

Setup stacked bar:
barPlot = [CPBarPlot tubularBarPlotWithColor:[CPColor darkGrayColor] 
                                             horizontalBars:  NO];
    barPlot.shouldStackBars = YES;
    barPlot.identifier = @"Bar Plot 2";
    barPlot.dataSource = self;

    [graph addPlot:barPlot toPlotSpace:barPlotSpace];

Values for negative bar(left on the screenshot)
-10;-15;-35;-45;-55;-100;-125

Original issue reported on code.google.com by Yanke...@gmail.com on 26 Oct 2010 at 8:55

Attachments:

GoogleCodeExporter commented 9 years ago
Is it reasonable to have negative values in a stacked bar chart?

Original comment by drewmcco...@mac.com on 8 Jan 2011 at 10:06

GoogleCodeExporter commented 9 years ago
If we have only negative values in the one bar - YES

Original comment by Yanke...@gmail.com on 10 Jan 2011 at 11:36

GoogleCodeExporter commented 9 years ago
I'm confused. I can't see stacked bars in Core Plot at all. Where did you get 
the version you are using?

Original comment by drewmcco...@mac.com on 26 Jan 2011 at 8:58

GoogleCodeExporter commented 9 years ago
Above, I gave the code that creates stacked bars:
barPlot.shouldStackBars = YES;

And when you gave data to bar - you set different values for one bar for stack

Original comment by Yanke...@gmail.com on 31 Jan 2011 at 12:46

GoogleCodeExporter commented 9 years ago
Hey, Drew,

I'm as surprised as you, but he might be using code based on the patch I 
created, which is located in the files section (I'll attach it again here), and 
discussed in this thread:

http://groups.google.com/group/coreplot-discuss/browse_thread/thread/a65885bf16a
a5a5e/b3b82880d13482f2?lnk=gst&q=stacked#b3b82880d13482f2

I moved off of the Core-Plot-using project, so I never got to advance beyond 
that, but I know that's the name I gave the stacking property.

Original comment by goo...@nibfile.com on 1 Feb 2011 at 1:49

Attachments:

GoogleCodeExporter commented 9 years ago
I was able to display a stacked bar chart by purely manipulating my data 
displayed.

Original comment by ccramer...@gmail.com on 18 Nov 2011 at 5:15

Attachments:

GoogleCodeExporter commented 9 years ago
Could you give me tips or a code fragment, how did you do that - 
"StackedChartExample_Cropped"? I would be very happy if I could get ahead at 
this point.

Original comment by eugen.wi...@gmail.com on 6 Jan 2012 at 8:38

GoogleCodeExporter commented 9 years ago

Original comment by eskr...@mac.com on 29 Dec 2013 at 1:45