ChartView
ChartView copied to clipboard
labels not working on v2?
tried this code:
import SwiftUI
import SwiftUICharts
struct TestView: View {
var body: some View {
PieChart()
.data([("Rent", 1300), ("Transport", 500)])
.chartStyle(.init(backgroundColor: .greenRed, foregroundColor: [.redBlack, .orangeBright]))
}
}
struct TestView_Previews: PreviewProvider {
static var previews: some View {
TestView()
}
}
and no labels are shown. both in landscape and portrait mode.
results can be seen here: https://imgur.com/a/n1EDas0
Looking thru the code for V2, it really doesn't seems like it's implemented. you can see that the code will separate out the DataPoints and the Label Strings, but it only uses the DataPoints and the Label Strings are not used at all. (at least I can't locate where they are within the BarChart codes)
Check this --> https://github.com/AppPear/ChartView/issues/243#issue-1258260740
Managed to get it done