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

Granularity in line chart not working (Chart3.0-Swift2.3 ) #1534

Closed
m9rc1n opened this issue Sep 22, 2016 · 4 comments
Closed

Granularity in line chart not working (Chart3.0-Swift2.3 ) #1534

m9rc1n opened this issue Sep 22, 2016 · 4 comments

Comments

@m9rc1n
Copy link

m9rc1n commented Sep 22, 2016

When I enable granularity in line chart, xAxis labels are gone. Without granularity labels are working correctly.

screen shot 2016-09-22 at 16 13 48

@danielgindi
Copy link
Collaborator

What value did you set for granularity?
You can see it working in the demos.

@m9rc1n
Copy link
Author

m9rc1n commented Sep 23, 2016

As far as I see the labels are not shown, when the granularity is set to true (with default 1.0) and the values are within scope of 1 (i.e. x = 0.1, x = 0.2, x = 0.8).

Not working sample:

vo2MaxValues.append(ChartDataEntry(x: 0.1, y: 23))
vo2MaxValues.append(ChartDataEntry(x: 0.23, y: 27))
vo2MaxValues.append(ChartDataEntry(x: 0.42, y: 29))

Working sample:

vo2MaxValues.append(ChartDataEntry(x: 0.1, y: 23))
vo2MaxValues.append(ChartDataEntry(x: 3.23, y: 27))
vo2MaxValues.append(ChartDataEntry(x: 6.42, y: 29))

It is working properly when the x-values have bigger range.

@danielgindi
Copy link
Collaborator

Granularity of 1 for x - 0.1, 0.23, 0.42 is obviously not a good choice.............

@m9rc1n
Copy link
Author

m9rc1n commented Sep 23, 2016

You are right, but the for me it will be more intuitive (since my data are independent from me) to display edge granularity (in that case: 0 and 1). In my case I need to present data with floating points values on xAxis and labels should visible every whole number.

I solved that by adding additional LineChartDataSet with edge values to LineChartData.

Thanks
Btw. your library is the best!

@m9rc1n m9rc1n closed this as completed Sep 23, 2016
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

2 participants