Permalink
Browse files

Fixed display issue with components containing exactly one data point.

  • Loading branch information...
1 parent daef8fd commit d7bcf381562a51fc3fbb23a9850e151ebe0c44e2 @lbehnke lbehnke committed Aug 30, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 iOSPlot/Shared/PCLineChartView.m
@@ -125,7 +125,16 @@ - (void)drawRect:(CGRect)rect
}
float margin = 45;
- float div_width = (self.frame.size.width-2*margin)/([self.xLabels count]-1);
+ float div_width;
+ if ([self.xLabels count] == 1)
+ {
+ div_width = 0;
+ }
+ else
+ {
+ div_width = (self.frame.size.width-2*margin)/([self.xLabels count]-1);
+ }
+
for (NSUInteger i=0; i<[self.xLabels count]; i++)
{
if (i % self.numXIntervals == 1 || self.numXIntervals==1) {

0 comments on commit d7bcf38

Please sign in to comment.