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

Stacked bar chart value label clipped #2974

Closed
MasterWatcher opened this issue Nov 9, 2017 · 4 comments
Closed

Stacked bar chart value label clipped #2974

MasterWatcher opened this issue Nov 9, 2017 · 4 comments

Comments

@MasterWatcher
Copy link

I changed demo StackedBarChartViewController as follows:

  1. Set Bottom Space Constraint of ChartView to 300
  2. Set _chartView.drawValueAboveBarEnabled = YES;
  3. Set data value font size to 12

Value label of second bar is clipped now

screenshot

How can I make value label always visible with any font size and ChartView height?

@liuxuan30
Copy link
Member

liuxuan30 commented Nov 10, 2017

turn off clipValuesToContentEnabled

@MasterWatcher
Copy link
Author

clipValuesToContentEnabled is false by default, so _chartView.clipValuesToContentEnabled = NO; doesn't change anything

@liuxuan30
Copy link
Member

I double check your question again. can you debug drawValues if

if !viewPortHandler.isInBoundsY(rect.origin.y)
                                || !viewPortHandler.isInBoundsLeft(x)
                            {
                                continue
                            }

this is not met? I suspect viewPortHandler.isInBoundsY(rect.origin.y) is false

@MasterWatcher
Copy link
Author

if !viewPortHandler.isInBoundsY(rect.origin.y)
                                || !viewPortHandler.isInBoundsLeft(x)
                            {
                                continue
                            }

from BarChartRenderer calls only if !dataSet.isStacked or // we still draw stacked bars, but there is one non-stacked in between. I have stacked bars only so this code doesn't even call.

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