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

Remove noDataText #3396

Closed
black-lotus opened this issue Apr 13, 2018 · 3 comments
Closed

Remove noDataText #3396

black-lotus opened this issue Apr 13, 2018 · 3 comments
Labels

Comments

@black-lotus
Copy link

What did you do?

ℹ set "noDataText" to empty String, to remove "No chart data available."

What did you expect to happen?

ℹ When my chart data is empty "No chart data available." should be gone

What happened instead?

ℹ "No chart data available." still displayed even my chart data is empty or nil

Charts Environment

Charts version/Branch/Commit Number: 3.1.1
Xcode version: 9.3
Swift version: 4.1
Platform(s) running Charts: iOS
macOS version running Xcode:

Demo Project

func initChart() {
        // prepare chart data container
        let data = LineChartData()

        // configure linechart
        self.chartView.noDataText = "" // this should be remove "No chart data available."
        self.chartView.scaleYEnabled = false
        self.chartView.scaleXEnabled = false
        self.chartView.pinchZoomEnabled = false
        self.chartView.doubleTapToZoomEnabled = false
        self.chartView.dragEnabled = false
        self.chartView.legend.enabled = false
        self.chartView.isUserInteractionEnabled = false
        self.chartView.fitScreen()

        // add data set
        data.addDataSet(EMPTY_DATA)

       // set chart view data
       self.chartView.data = data
}

Any help would be appreciated,
Thank you

@jjatie jjatie added the bug label Apr 15, 2018
@black-lotus
Copy link
Author

Fixed, it was my fault.

I should call initChart() on awakeFromNib() instead of after asynchronous call

@ghost
Copy link

ghost commented May 29, 2019

This lead me in the right direction. For others where they add the chart as a class on a view from the interface and make it an outlet, the value needs to be set in the viewDidLoad.

@bazilhassan
Copy link

i'm Using BarChart and setting noDataText value empty but value is not changing? Can you please tell me how to fix this ?
BarChartView.noDataText = ""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants