Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove Description Label in ios-chart?

I am trying to remove Description Label in ios-chart library. You can see it on the image below:

enter image description here

And I know that, on Android (MPAndroidChart library which is the predecessor of ios-chart), I can do the following:

barchart.setDescription(" ");

but I am trying to do the same on Swift:

barchart.description = ""

and I am getting the following error:

Cannot assign to property: 'description' is immutable

I have looked on the Internet and here in StackOverflow but could not see anything to remove it.

Is it possible to remove that Description Label on ios-chart library?

Thanks in advance!

like image 599
Francisco Romero Avatar asked Sep 21 '16 09:09

Francisco Romero


2 Answers

It's descriptionText, not description, description is NSObject variable

On Swift 3.0 and Chart 3.0:

barchart.chartDescription?.text = ""
like image 149
Tj3n Avatar answered Nov 19 '22 08:11

Tj3n


It could work better in Swift 3.0 by disabling as

   barChart.chartDescription?.enabled = false
like image 31
Ade Avatar answered Nov 19 '22 09:11

Ade