Skip to content

Instantly share code, notes, and snippets.

@victor
Created October 23, 2012 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victor/3938857 to your computer and use it in GitHub Desktop.
Save victor/3938857 to your computer and use it in GitHub Desktop.
patch for core plot
diff -r c4b3ac52ecc8 framework/Source/CPTXYPlotSpace.m
--- a/framework/Source/CPTXYPlotSpace.m Wed Oct 03 20:47:35 2012 -0400
+++ b/framework/Source/CPTXYPlotSpace.m Tue Oct 23 15:45:50 2012 +0200
@@ -6,6 +6,7 @@
#import "CPTGraphHostingView.h"
#import "CPTMutablePlotRange.h"
#import "CPTPlot.h"
+#import "CPTBarPlot.h"
#import "CPTPlotArea.h"
#import "CPTPlotArea.h"
#import "CPTPlotAreaFrame.h"
@@ -354,6 +355,15 @@
for ( CPTPlot *plot in plots ) {
CPTPlotRange *currentXRange = [plot plotRangeForCoordinate:CPTCoordinateX];
CPTPlotRange *currentYRange = [plot plotRangeForCoordinate:CPTCoordinateY];
+
+ if ([plot isKindOfClass:[CPTBarPlot class]]) {
+ if (((CPTBarPlot *)plot).barsAreHorizontal) {
+ currentYRange = [(CPTBarPlot *)plot plotRangeEnclosingBars];
+ } else {
+ currentXRange = [(CPTBarPlot *)plot plotRangeEnclosingBars];
+ }
+ }
+
if ( !unionXRange ) {
unionXRange = [currentXRange mutableCopy];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment