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

How to remove xAxis and yAxis lines? #197

Closed gesabo closed 2 years ago

gesabo commented 2 years ago

Even without a grid or setting the gridlines to .clear, I can't seem to find a way to remove the thin xAxis and xAxis lines here, is there a way? 🤔

image

willdale commented 2 years ago

Hey @gesabo, set

LineChartStyle(...,
    xAxisBorderColour: nil,
    yAxisBorderColour: nil,
    ....
gesabo commented 2 years ago

Thank you! 🙏

gesabo commented 2 years ago

@willdale for my use case I actually wanted to to keep the X and Y Axis labels for purposes of preserving space and setting their text color as .clear (I was trying to overlay 1 chart over another chart), and I found that these lines wouldn't be removed unless I removed, e.g. .xAxisLabels(chartData: data). I understand this is sort of "off label" use (bad pun 😆 ) but would be nice if ever possible.

gregorpichler commented 2 years ago

I agree with @gesabo, it would be great if we could remove the line but still have the labels (xAxis and/or yAxis). If I set xAxisBorderColour: nil it only works if I remove .xAxisLabels(chartData: data). Am I missing something here @willdale?

BenjaminAlbrectsen commented 1 year ago

I'm also having issues with this, setting xAxisBorderColour: nil and yAxisBorderColour: nil does not seem to affect it. @willdale

IMG_72C97DBDB650-1