PNChart icon indicating copy to clipboard operation
PNChart copied to clipboard

Release 0.8.9 bug.

Open cywd opened this issue 6 years ago • 0 comments

PNRadarChart can not change plotColor.

self.radarChart.plotColor = [UIColor yellowColor];

This is code in PNRadarChart.m (Release 0.8.9).

- (void)strokeChart {
    
    [self calculateChartPoints];
    [self setNeedsDisplay];
    [_detailLabel setHidden:YES];
    
    //Draw plot
    [_chartPlot removeAllAnimations];
    UIBezierPath *plotline = [UIBezierPath bezierPath];
    CGPoint beginPoint = [[_pointsToPlotArray objectAtIndex:0] CGPointValue];
    [plotline moveToPoint:CGPointMake(beginPoint.x, beginPoint.y)];
    for(NSValue *pointValue in _pointsToPlotArray){
        CGPoint point = [pointValue CGPointValue];
        [plotline addLineToPoint:CGPointMake(point.x ,point.y)];
        
    }
    [plotline setLineWidth:1];
    [plotline setLineCapStyle:kCGLineCapButt];
    
    _chartPlot.path = plotline.CGPath;

    [self addAnimationIfNeeded];
    [self showGraduation];
}

This is code in PNRadarChart.m (Now Master Souce Code).

- (void)strokeChart {
    
    [self calculateChartPoints];
    [self setNeedsDisplay];
    [_detailLabel setHidden:YES];
    
    //Draw plot
    [_chartPlot removeAllAnimations];
    UIBezierPath *plotline = [UIBezierPath bezierPath];
    CGPoint beginPoint = [[_pointsToPlotArray objectAtIndex:0] CGPointValue];
    [plotline moveToPoint:CGPointMake(beginPoint.x, beginPoint.y)];
    for(NSValue *pointValue in _pointsToPlotArray){
        CGPoint point = [pointValue CGPointValue];
        [plotline addLineToPoint:CGPointMake(point.x ,point.y)];
        
    }
    [plotline setLineWidth:1];
    [plotline setLineCapStyle:kCGLineCapButt];
    
    _chartPlot.path = plotline.CGPath;
    
    _chartPlot.fillColor = _plotColor.CGColor;

    [self addAnimationIfNeeded];
    [self showGraduation];

//    self.transform = CGAffineTransformMakeRotation(-M_PI_2);
}

cywd avatar Nov 23 '18 03:11 cywd