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

Show % Percentage value with Legend data #621

Closed
TheEngineerz opened this issue Dec 21, 2015 · 1 comment
Closed

Show % Percentage value with Legend data #621

TheEngineerz opened this issue Dec 21, 2015 · 1 comment

Comments

@TheEngineerz
Copy link

I want to show value like this

screen shot 2015-12-21 at 1 18 35 pm

currently by default i have this kind of screen

screen shot 2015-12-21 at 1 20 48 pm

my code is like this

let pieChart:PieChartView = PieChartView(frame: CGRectMake(0, CGFloat(y), (self.view.frame.width/1.3), (self.view.frame.width/1.3)))
pieChart.center=CGPointMake(UIScreen.mainScreen().bounds.width/2, UIScreen.mainScreen().bounds.height - (self.view.frame.width/1.6))
pieChart.descriptionText = ".="
pieChart.usePercentValuesEnabled = false
pieChart.drawHoleEnabled=true
pieChart.holeTransparent = true
pieChart.rotationAngle = 0.0
pieChart.rotationEnabled = true
pieChart.legend.enabled = true
pieChart.animate(xAxisDuration: 1.5, yAxisDuration: 1.5, easingOption: ChartEasingOption.EaseOutBack)
myview.addSubview(pieChart)
let pcDatapoints = [pc2Labels[0] as! String,pc2Labels[1] as! String,pc2Labels[2] as! String,pc2Labels[3] as! String]
let legend:ChartLegend = pieChart.legend
legend.position = ChartLegend.ChartLegendPosition.RightOfChartInside

@TheEngineerz TheEngineerz changed the title Percentage value with Legend data Show % Percentage value with Legend data Dec 21, 2015
@liuxuan30
Copy link
Member

you could change the source code or override chart legend implementation to whatever you like.
To me, simply use your wanted strings as the x values will be good to go as you could see the legend shows the same thing as your x values

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