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

Chart not centered/middled when having less values #1605

Closed
sree127 opened this issue Oct 4, 2016 · 1 comment
Closed

Chart not centered/middled when having less values #1605

sree127 opened this issue Oct 4, 2016 · 1 comment

Comments

@sree127
Copy link

sree127 commented Oct 4, 2016

If a chart has only few Data Entries, the chart items are moving to extreme ends rather than starting in the middle. Is this the default chart behaviour? Or is there a way to achieve this?

screen shot 2016-10-04 at 1 35 57 pm

While adding the entries, I tried giving an offset to x like below :

     for(index, object) in response.enumerated() {


            let some = BarChartDataEntry(x: Double(index) + 1.0, yValues: [Double(10), Double(10), Double(10)])
            dataEntry.append(some)
        }

Still the chart is not moving from the extreme ends? Also set these 2 properties :

chartView.fitBars = false
xAxis.avoidFirstLastClippingEnabled = true

@liuxuan30 @danielgindi @Huang-Libo Any leads?

@liuxuan30
Copy link
Member

Would you try ChartsDemo? I didn't see it in ChartDemo

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