-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
PieChart value labels are overlaping when values are between 0 to 9 #2948
Comments
Is the problem solved, brother |
I don't think this can be easily solved, as the slices are too thin to hold a font that has a bigger height. Think about the math. Either you manually change the offset, if overlap happens, or use a smaller font size. But there will always be corner cases, so... I will keep this open if someone have better solutions. |
crap, I just found #2062, seems a PR to hide small slice labels. but as I said, it solve the issue by hiding the label, not showing two labels without overlap. up to you. |
@liuxuan30 Yeah. I saw this when I first face this issue. But I think this can be solved if pie chart a little bigger. But this approach makes other pieces shrink their size. I did some tweaks in this project but I couldn't make it. I don't have enough math knowledge to solve this. :/ |
how do you want to make the pie chart bigger? in terms of radius? It has to be restrained with the contentRect, and the labels, and the parent view. |
@liuxuan30 Nope. I don't want to make the whole chart bigger I just want to make only pieces who has %1 percentage value a bit bigger than others. Thus label can appear without any overlapping. |
the arc length and eventually depends on the radius as well |
I think the solution would be to move the label further away from the chart to prevent it from overlapping. I don't think anyone has time to implement a solution for this, and I don't think it's critical. |
Hi,
I'm using PieChart but when values are between 0 to 9 side by side they are overlaping. Is there any solution to fix this? I've added screenshot and my implementation below.
Here it is my implementation:
`let chartView = PieChartView()
let screenFrame = view.frame
chartView.frame = CGRect(x: 0, y: 10, width: screenFrame.width, height: screenFrame.height - 100)
chartView.usePercentValuesEnabled = false
chartView.drawSlicesUnderHoleEnabled = false
chartView.chartDescription?.enabled = false
chartView.setExtraOffsets(left: 25.0, top: 10.0, right: 25.0, bottom: 0.0)
chartView.drawCenterTextEnabled = true
chartView.noDataText = "Veri girişi yok."
chartView.drawHoleEnabled = false
chartView.rotationAngle = 10.0
chartView.rotationEnabled = true
chartView.highlightPerTapEnabled = true
chartView.entryLabelColor = .white;
chartView.entryLabelFont = UIFont.defaultAppFont(size: 18)
// dataSet.xValuePosition = .outsideSlice
dataSet.yValuePosition = .outsideSlice
dataSet.valueLinePart1Length = 0.6
dataSet.valueLinePart2Length = 0.9
dataSet.valueLineColor = UIColor.bgBlackColor
dataSet.sliceSpace = 1.0
dataSet.colors = colors
dataSet.entryLabelColor = UIColor.clear
The text was updated successfully, but these errors were encountered: