Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline chart show only one line chart when x values of datasets are different #4843

Open
huynguyencong opened this issue Jun 15, 2022 · 4 comments

Comments

@huynguyencong
Copy link

What did you do?

I was adding a multiline chart to my app using LineChartView, the same code as example code in LineChart2ViewController. The only different thing from the example is datasets has different x values.

What did you expect to happen?

The chart show multilines with different x values.

What happened instead?

Only one line showed, the other lines just show dots. You can reproduce it by update line 96 in the file LineChart2ViewController.swift in the example project, change to i + 1 from i.
return ChartDataEntry(x: Double(i + 1), y: val)

Charts Environment

Charts version/Branch/Commit Number: 4.0.3/master/b38b8d45a8cbda9f0f2a3566778ed114f06056b7
Xcode version: 13.2.1
Swift version: 5.5.2
Platform(s) running Charts: iOS
macOS version running Xcode: 11.5.2

Demo Project

The demo project is the example project of this library. The only thing I changed is line 96 in the file LineChart2ViewController.swift, to make x value of data set 1 different to the other two data sets. Please build the project, tap Line Chart (Dual YAxis) to see the problem.
https://drive.google.com/file/d/1AX-0QbQt8ro_joP2iiDGPksXaWA-l4JI/view?usp=sharing

Screenshots

What I expected:
Expected
What it happened:
Bug
What I did:
Code

@fjgmmg
Copy link

fjgmmg commented Jun 16, 2022

I’m having this issue too. Makes the library not very usable for my use case

@TKZwo
Copy link

TKZwo commented Jun 17, 2022

We have seen this issue too and it is the main reason for us to keep using version 3.6.0 until this Is fixed.

I've determined the linegraphs are calculating some Bounds object which ends up with an internal endpoint of nil and thus returns a range of min = 0, max = 0 and a range of 0 so only the first point gets drawn

@fjgmmg
Copy link

fjgmmg commented Jun 17, 2022

@TKZwo thank you! I didn’t realize it was just a problem with the new version. I’ll try the older version.

@FelixHerrmann
Copy link
Contributor

#4829 fixes that!

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants