ChartView icon indicating copy to clipboard operation
ChartView copied to clipboard

labels not working on v2?

Open nimrodbens opened this issue 2 years ago • 2 comments

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

nimrodbens avatar Jul 23 '22 13:07 nimrodbens

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)

app4g avatar Jul 26 '22 15:07 app4g

Check this --> https://github.com/AppPear/ChartView/issues/243#issue-1258260740

Managed to get it done

app4g avatar Jul 27 '22 03:07 app4g