willdale / SwiftUICharts

A charts / plotting library for SwiftUI. Works on macOS, iOS, watchOS, and tvOS and has accessibility features built in.
MIT License
837 stars 103 forks source link

yAxisPOI below 0 when xAxisLabelsFrom rotated 90 degrees #211

Open nikolafamit opened 2 years ago

nikolafamit commented 2 years ago

When i rotate labels for 90 degrees in xAxisLabelsFrom for BarChartStyle, the yAxisPOI goes under 0. On the pic yAxisPOI value is 500. Also it's moved out of screen

Screen Shot 2022-07-04 at 00 54 38 AM

0

BarChart(chartData: datas)
    .touchOverlay(chartData: datas)
    .xAxisLabels(chartData: datas)
    .yAxisLabels(chartData: datas)
    .headerBox(chartData: datas)
    .yAxisPOI(chartData: datas,
            markerName: "Minimum Recommended",
            markerValue: Double(statTargetValueDay) ?? 0.0,
            labelPosition: .yAxis(specifier: "%.2f", formatter: .none),
            labelColour: Color.accentColor,
            labelBackground: .clear ,
            lineColour: Color(red: 0.25, green: 0.75, blue: 1.0),
            strokeStyle: StrokeStyle(lineWidth: 1, dash: [5,10]))
    .id(datas.id)
    .frame(height: UIScreen.screenHeight/2.2,alignment: .center)
    .padding([.vertical,.horizontal])