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

How to get y-axis values "Int" to "Double" #2799

Closed
SreekanthGudisi opened this issue Sep 19, 2017 · 1 comment
Closed

How to get y-axis values "Int" to "Double" #2799

SreekanthGudisi opened this issue Sep 19, 2017 · 1 comment

Comments

@SreekanthGudisi
Copy link

SreekanthGudisi commented Sep 19, 2017

screen shot 2017-09-19 at 8 12 55 pm

Here is code :-

func setChart(_ lineChartView: LineChartView, dataPoints: [String], values: [Double]) {
    
    let graphDataList = GraphDataWeekly.getGraphDataList()
    if graphDataList?.count == 0 {
        return
    }
    
    var count = 0
    var dataEntries: [ChartDataEntry] = []
    var xAxisDataPoints = [Any]()
    
    for graphData in graphDataList! {
        let dataEntry = ChartDataEntry(x: Double(count), y: graphData.kwh! )
        dataEntries.append(dataEntry)
        xAxisDataPoints.append(DataPointFormatter.javaUtilDateFromDateString(graphData.createdOn!))
        count += 1
    }

But y-axis data coming in console in double value,

screen shot 2017-09-19 at 8 34 45 pm

Then finally, how to get y-axis values "int" to "Double" ?

@SreekanthGudisi SreekanthGudisi changed the title How to get y-axis values "int" to "Double" How to get y-axis values "Int" to "Double" Sep 19, 2017
@liuxuan30
Copy link
Member

liuxuan30 commented Sep 21, 2017

It's Double(Int), seems a CS lesson 101 to learn for you..

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