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

Line not showing in LineChart #2518

Closed
RiverWinz opened this issue Jun 14, 2017 · 4 comments
Closed

Line not showing in LineChart #2518

RiverWinz opened this issue Jun 14, 2017 · 4 comments

Comments

@RiverWinz
Copy link

I am trying to draw a line chart but I am not able to get a line. Everything else seem to be responding to my data i.e. axis scale, label color etc.

Am I doing something wrong or is this a bug?

    var dataEntries: [ChartDataEntry] = []
    
    for i in 1...5 {
        let dataEntry = ChartDataEntry(x: Double(i), y: Double(i))
        dataEntries += [dataEntry]
    }
    
    let chartDataset = LineChartDataSet(values: dataEntries, label: "Test")
    
    var datasets = [IChartDataSet]()
    datasets += [chartDataset]
    
    let chartData = ChartData(dataSets: datasets)
    chartView.data = chartData
@thierryH91200
Copy link
Contributor

modify
var datasets = LineChartDataSet
datasets += [chartDataset]

let chartData = LineChartData(dataSets: datasets)
chartView.data = chartData

@RiverWinz
Copy link
Author

That still does not solve the problem. No line in the graph, but doing debugging it seems that the data is in "chartData"

@RiverWinz
Copy link
Author

Sorry....me being a newbie messing up the different data types.

@ibrahimyilmaz7
Copy link

ibrahimyilmaz7 commented Jun 15, 2017

For other people who have same problem: (Line not showing, Line disappearing on zoom)

#Make sure your xAxis data is ordered.

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