-
-
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
Radar charts custom labels #1840
Comments
I think you should use valueFormatter to do that, as you already see where it formats.. Labels are just labels sometimes. |
/// Sets labels that should be drawn around the RadarChart at the end of each web line.
open var labels: [String] ok... |
@chipp lol. But the code tells everthing :( |
any news here? |
@tlimp this is my production solution: chartView.xAxis.valueFormatter = RadarChartXValueFormatter(withLabels: labels) class RadarChartXValueFormatter: NSObject, IAxisValueFormatter {
init(withLabels labels: String...) {
self.labels = labels
super.init()
}
init(withLabels labels: [String]) {
self.labels = labels
super.init()
}
var labels: [String]
func stringForValue(_ value: Double, axis: AxisBase?) -> String {
let index = Int(value)
return labels.indices ~= index ? labels[index] : ""
}
} |
@chipp |
same issue here, have labels with roughly 10 characters and it's shrinking the chart a lot sometimes the chart is not readable at all :( |
Custom radar chart labels are broken.
I added this code to
ChartsDemo-OSX/ChartsDemo-OSX/Demos/RadarDemoViewController.swift
:but RadarChartView ignores these labels.
![screenshot 2016-11-16 23 07 48](https://cloud.githubusercontent.com/assets/115227/20364595/c51191d6-ac54-11e6-94c4-b16131dcc5f2.png)
I think problem is in this line: XAxisRendererRadarChart.swift#L57
XAxisRendererRadarChart
ignoresRadarChartData.labels
property.The text was updated successfully, but these errors were encountered: