swiftcharts

SwiftCharts cutting off points (clips bounds)


I am tweaking the Areas Example project from SwiftCharts and I am running into the issue where the point indicators are getting cut off like so:

enter image description here

In the github issues a found this and this other issue where the solutions were to set chartSettings.clipInnerFrame = false

However, when I do this the the area color awkward shape also becomes visible like so:

enter image description here

How can I get the whole shape of the points but all the other stuff?


Solution

  • You have to pass to the ChartPointsViewsLayer with the points clipViews: false (see example). ChartSettings.clipInnerFrame has to be true (i.e. the default). This way only the layer with the points is clipped.

    Finally, if you want to clip the unclipped points layer (to limit the area outside of the chart where they are displayed), you can do it passing a custom rectangle, like here (this setting is admittedly not very intuitive).