Swift Chats chartScrollTargetBehavior is not working correctly when domain count is relatively small

I’m seeing a strange behavior when using chartScrollTargetBehavior and trying to scroll to a majorAlignment (.matching(DateComponents(day: 1))).

let numberOfBarMarks = 10
.chartXVisibleDomain(length:3600 * 24 * numberOfBarMarks)

.chartScrollTargetBehavior(
  .valueAligned(
		matching: DateComponents(hour: 0),
		majorAlignment: .matching(DateComponents(day: 1)))
   )
)

The issue is fully reproducible.

I believe the issue is related to the number of bar marks being displayed in a domain. If I use 10 then the issue shows up, if I use 30 the issue doesn’t happen.

Filed as FB13889037 including video and sample code.

Swift Chats chartScrollTargetBehavior is not working correctly when domain count is relatively small
 
 
Q