Skip to content

Commit c64d63b

Browse files
committedSep 27, 2012
Merge branch 'master' of github.com:honcheng/iOSPlot
2 parents 2c049e7 + 1d36786 commit c64d63b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed
 

‎iOSPlot/Shared/PCLineChartView.m

+10-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,16 @@ - (void)drawRect:(CGRect)rect
125125
}
126126

127127
float margin = 45;
128-
float div_width = (self.frame.size.width-2*margin)/([self.xLabels count]-1);
128+
float div_width;
129+
if ([self.xLabels count] == 1)
130+
{
131+
div_width = 0;
132+
}
133+
else
134+
{
135+
div_width = (self.frame.size.width-2*margin)/([self.xLabels count]-1);
136+
}
137+
129138
for (NSUInteger i=0; i<[self.xLabels count]; i++)
130139
{
131140
if (i % self.numXIntervals == 1 || self.numXIntervals==1) {

0 commit comments

Comments
 (0)
Please sign in to comment.