Help needed for s7graphview
If anyone have used s7graphview for plotting the graph then I want to know where to do changes in the code for maintaining the incremental value of the values that is been plot on the x-axis. Currently it maintains according to the count of array being return to it. I want to maintain increment开发者_JS百科al gap of 5 units.
I replace in drawRect:
of S7GraphView
class next lines (~220 line in S7GraphView.m):
if (xValuesCount > 5)
{
NSUInteger stepCount = 5;
NSUInteger count = xValuesCount - 1;
for (NSUInteger i = 4; i < 8; i++) {
if (count % i == 0) {
stepCount = i;
}
}
step = xValuesCount / stepCount;
maxStep = stepCount + 1;
}
else
{
step = 1;
maxStep = xValuesCount;
}
with this code:
if (xValuesCount > 5)
{
NSUInteger stepCount = 5 - 1;
step = xValuesCount / stepCount;
maxStep = stepCount + 1;
}
else
{
step = 1;
maxStep = xValuesCount;
}
On DemoS7GraphView project from s7graph google code page it gives me next result:
Hope it helps.
精彩评论