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

Cant understand .axisMaxValue #1054

Closed
ADevelopStudio opened this issue May 20, 2016 · 6 comments
Closed

Cant understand .axisMaxValue #1054

ADevelopStudio opened this issue May 20, 2016 · 6 comments

Comments

@ADevelopStudio
Copy link

Wanted to put percentage limits of 100% to graph to show values more obvious.
because, for instance, if value of 6% is the max in this data, it looks like 99% ( I mean it fills whole bar, not just small part of it)
form demo example of BarChart:

   ChartYAxis *leftAxis = _chartView.leftAxis;
    leftAxis.axisMaxValue = 100.0;

it working fine! however on my own code (Swift) it is not working at all...

        let leftAxis = barChartView.leftAxis
        leftAxis.axisMaxValue = 100.0

Which is strange because the one:

  leftAxis.axisMinValue = 0.0;

is working...
May be I do not understand something...
screen shot 2016-05-20 at 14 38 08

@danielgindi
Copy link
Collaborator

Maybe your values are not percentages? Just the formatter is showing the percentage?

@ADevelopStudio
Copy link
Author

chartData.getYMax() returns "5.56"
SO I tried both
leftAxis.axisMaxValue = 1
leftAxis.axisMaxValue = 100
result is the same

@danielgindi
Copy link
Collaborator

Check which y axis is your data dependent on. Also maybe you should just disable the right y axis?

@ADevelopStudio
Copy link
Author

To be honest not 100% sure that did you mean.
I tried to disable each of them separately and together. but can't see any difference.
If I use
rightAxis.drawAxisLineEnabled = true
rightAxis.drawGridLinesEnabled = true
or
leftAxis.drawAxisLineEnabled = true
leftAxis.drawGridLinesEnabled = true
I see values on every side - so can't understand

Check which y axis is your data dependent on

@danielgindi
Copy link
Collaborator

Check the first line chart demo and the dual-axis one.
You can have different y-axis range on the right axis. And if your dataset depends on the left-axis, and the left-axis is the one that should be configured for this.

@danielgindi
Copy link
Collaborator

Basically setting axisMaxValue on the correct axis should do the trick. You just have to find out which axis that is :-)

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