ChartsOrg / ChartsOrg/Charts

Charts only load when methods are placed in viewDidLoad and viewDidAppear

Open
#4,679 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
28k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have two charts that are displayed in a popup modal window, and I have to load both charts in the viewDidLoad and viewDidAppear methods. If I delete the code that runs them from either method, the charts don't load. This can use up a lot of CPU and memory. How do I fix this?

* [ ] 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?

I took out the code that loads the charts from viewDidAppear and the charts don't load. I did the same thing with the code that loads the charts in the viewDidLoad method, and the same issue appears.

## What did you expect to happen?

I expected the charts to load even when I took them out of the viewdidload or viewdidappear methods

## What happened instead?

When I took the loading code out of either of the methods the charts didn't load

## Charts Environment

**Charts version/Branch/Commit Number: 3.6.0
**Xcode version: 12.5.1
**Swift version: 5.5
**Platform(s) running Charts: iPhone
**macOS version running Xcode: 11.4

## Demo Project

ℹ Please link to or upload a project we can download that reproduces the issue.

https://github.com/jaredrkozar/StepCounter/tree/main/StepCounter

(the issue is in the StatisticsViewController class)

Contributor guide

Open the contributing guide

Research direction

Start with the StatisticsViewController class in the linked StepCounter demo and reproduce the chart setup when moved between viewDidLoad and viewDidAppear. Compare the behavior with the Charts 3.6.0 environment described in the issue. Done means establishing whether this is a Charts defect or an application lifecycle issue, with a confirmed diagnosis and appropriate regression coverage if the library is implicated.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.