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

lineChart.leftAxis.startAtZeroEnabled is not available in Swift 3 library #2262

Closed
shivang2902 opened this issue Mar 21, 2017 · 6 comments
Closed

Comments

@shivang2902
Copy link

Hi @danielgindi , @liuxuan30

I wanted to skip the 0 of the left axis and i found the solution "lineChart.leftAxis.startAtZeroEnabled = false" but it is not available in the Swift 3 branch of Charts.

Is this removed or have been changed to other function ?
Thanks

@thierryH91200
Copy link
Contributor

in v2

 /// This is deprecated now, use `axisMinValue`
    @available(*, deprecated=1.0, message="Use axisMinValue instead.")
    public var isStartAtZeroEnabled: Bool { return startAtZeroEnabled }

in v3

/// This property is deprecated - Use `axisMinimum` instead.
 @available(*, deprecated: 1.0, message: "Use axisMinimum instead.")
 open var axisMinValue: Double
     {
     get { return axisMinimum }
     set { axisMinimum = newValue }
 }

@shivang2902
Copy link
Author

Thanks @thierryH91200 , but i have used my custom left axis value formatter to eliminate 0.
Thanks anyways

@shivang2902
Copy link
Author

shivang2902 commented Mar 21, 2017

screen shot 2017-03-21 at 5 56 43 pm

@thierryH91200 Can you help me stop the line just before the 12 xAxis mark, Please refer the screenshot i need to replicate in my app. I tried various things but nothing help
Thanks a lot

@shivang2902
Copy link
Author

shivang2902 commented Mar 21, 2017

@thierryH91200 , @danielgindi , @liuxuan30, @petester42, @AlBirdie can you please help me on the above issue
The situation is that i need to show the data of 4 hours [3 hours past, 1 hour future], suppose the current time is 11 so the line graph will be plotted from 9 - 11, but 11 -12 will have no line graph, for now i am giving 0 value for data ahead of 11 which makes the graph drop on xAxis. As i saw the MPAndroidChart can accepts separate values for x and y axis which makes this scenario possible.
let data: LineChartData = LineChartData(xVals: months, dataSets: dataSets)
The above function has been removed from latest version of the library or it could have solved my purpose.
Please help me to achieve this one guys !!

P.S : i am using iOS Swift 3.0

@shivang2902
Copy link
Author

shivang2902 commented Mar 22, 2017

@thierryH91200 , @danielgindi , @liuxuan30, @petester42, @AlBirdie is this possible to achieve with ios-charts ?

@liuxuan30
Copy link
Member

you can set your x to be 12h and have y value. You can also use axisMimimum/max to set the axis range.

Reopen a closed issue with a different question is NOT a good habit.

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

3 participants