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

Making HorizontalBarChartView scrolling vertically #839

Closed
NSri opened this issue Mar 13, 2016 · 2 comments
Closed

Making HorizontalBarChartView scrolling vertically #839

NSri opened this issue Mar 13, 2016 · 2 comments

Comments

@NSri
Copy link

NSri commented Mar 13, 2016

I am using HorizontalBarChartView for displaying bars, when the bar exceeds 8 I want to make the HorizontalBarChartView scroll vertically. I tried setting

        let maxBarToDisplay: CGFloat = 8.0
        self.horizontalBarChart.setVisibleXRangeMaximum(maxBarToDisplay)
        self.horizontalBarChart.maxVisibleValueCount = Int(maxBarToDisplay)

but it's not working. Even I tried this is in ChartDemo.

How can I make HorizontalBarChartView scroll vertically when it exceeds certain limit?

I had asked this question, when i searched for that I didn't see the question so posting it again. Sorry if it's a repetition.

@liuxuan30
Copy link
Member

maxVisibleValueCount is not setting the range, but just the number of maximum visible drawn values on the chart, and only active when setDrawValues() is enabled. It's in the comment. So next time you are not sure the meaning, check out its comment

for horizontal bar chart, you should use setVisibleYRangeMaximum
like

[_chartView setVisibleYRangeMaximum:4.0 axis:AxisDependencyLeft];

I guess you have to call it after you set the data, since it eventually is trying to modifty the matrix. and the matrix is settled down after we set the data. you can try it.

@NSri
Copy link
Author

NSri commented Mar 14, 2016

I am setting setDrawValues() to true.
Setting - [_chartView setVisibleYRangeMaximum:4.0 axis:AxisDependencyLeft]; after setting the data for chart works fine.

@NSri NSri closed this as completed Mar 14, 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