We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents daef8fd + d7bcf38 commit 1d36786Copy full SHA for 1d36786
iOSPlot/Shared/PCLineChartView.m
@@ -125,7 +125,16 @@ - (void)drawRect:(CGRect)rect
125
}
126
127
float margin = 45;
128
- float div_width = (self.frame.size.width-2*margin)/([self.xLabels count]-1);
+ 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
+
138
for (NSUInteger i=0; i<[self.xLabels count]; i++)
139
{
140
if (i % self.numXIntervals == 1 || self.numXIntervals==1) {
0 commit comments