Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PieChartView settings color is Invalid #3668

Closed
AflyingApple opened this issue Sep 29, 2018 · 1 comment
Closed

PieChartView settings color is Invalid #3668

AflyingApple opened this issue Sep 29, 2018 · 1 comment

Comments

@AflyingApple
Copy link

  1. What did you do?
    I want to change the color of the text individually and distinguish percentages of colors and text colors.

  2. What did you expect to happen?

Can not set the text color alone, invalid

Like this(DEMO):
#import "PieChartViewController.h"
PieChartViewController

_chartView.entryLabelColor = UIColor.blackColor;
_chartView.entryLabelFont = [UIFont fontWithName:@"HelveticaNeue-Light" size:12.f];


[data setValueFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:11.f]];
[data setValueTextColor:UIColor.whiteColor];

5eba502a-7956-4e24-83b0-4c38ef05fe3e

  1. Charts Environment

**Charts version Number:3.2.0
**Xcode version:10.0
**Swift version:4.2
**Platform(s) running Charts:iOS
**macOS version running Xcode:10.14

@liuxuan30
Copy link
Member

                        {
                            ChartUtils.drawText(
                                context: context,
                                text: pe!.label!,
                                point: CGPoint(x: labelPoint.x, y: labelPoint.y + lineHeight),
                                align: align,
                                attributes: [
                                    NSAttributedString.Key.font: entryLabelFont ?? valueFont,
                                    NSAttributedString.Key.foregroundColor: entryLabelColor ?? valueTextColor]

you shouldn't set two color at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants