ChartsOrg / ChartsOrg/Charts

Linechart on tvOS creates multiple overlapping charts when data is added

Open
#5,065 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
28k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

* [ X] I've read, understood, and done my best to follow the [*CONTRIBUTING guidelines](https://github.com/jjatie/Charts/blob/master/CONTRIBUTING.md).

## What did you do?
In tvOS, I have a LineChartView that displays on the `customOverlayViewController` of `AVPlayerViewController`. Over time, data is added to the LineChart & the chart is updated.

## What did you expect to happen?
I expected that as the data was updated, that the chart would update as well, no longer showing the previous data as it does using the exact same code in iOS, shown below.
![Simulator Screenshot - iPhone 14 - 2023-05-30 at 13 23 14](https://github.com/danielgindi/Charts/assets/105233656/47be34bf-9775-4242-9efe-4e4cf6c3bd48)

## What happened instead?

In tvOS, when new data is added to an existing line chart, the visualization creates a new line chart image that overlaps the previous image. This is true whether the entire dataSet is replaced or if items are added to the dataSet.
I have verified:
- there is only only dataSet
- that the one dataSet is being appended to & another one is not being created
- there is only one instance of the LineChartView
![Simulator Screenshot - Apple TV 4K (3rd generation) - 2023-05-30 at 13 34 26](https://github.com/danielgindi/Charts/assets/105233656/8d0113ec-b18f-43e1-864f-6c4b0042b1cf)

## Charts Environment

**Charts version/Branch/Commit Number:** 4.1.0
**Xcode version:** 14.3
**Swift version:** 5.8
**Platform(s) running Charts:** iOS & tvOS
**macOS version running Xcode:** Ventura 13.3

## Demo Project

Not available.

Contributor guide

Open the contributing guide

Research direction

The reported entry point is a LineChartView used in customOverlayViewController of AVPlayerViewController; reproduce the update path on tvOS and compare it with iOS behavior. Done means adding data or replacing the data set redraws a single chart without retaining the previous rendering; no demo project or file/test is provided, so locating the implementation is part of the work.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
data-visualization, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.