mzimmerm / flutter_charts

Charts Library for Flutter, written in Dart with Flutter.
Other
250 stars 42 forks source link

useUserProvidedYLabels cannot be used as a setting because it is final #13

Closed Winghin2517 closed 2 years ago

Winghin2517 commented 6 years ago

I have been trying to run the sample code but it is giving me the following error on the line:

 _lineChartOptions.useUserProvidedYLabels = true;

It says:

useUserProvidedYLabels cannot be used as a setting because it is final

Please may you fix.

moda20 commented 5 years ago

This is still a problem, did anybody figure it out ?

mzimmerm commented 2 years ago

@Winghin2517 @moda20 If this is still relevant: Any option can be set in code as follows:

(Caveat: This code is from flutter_charts v. 0.3.0, which is different from the version at the time of the question.)

            chartOptions = LineChartOptions(
              chartOptions: const ChartOptions(
                yContainerOptions: YContainerOptions(useUserProvidedYLabels: true), // use Y labels below
              ),
            );

Please also take a look at https://github.com/mzimmerm/flutter_charts/blob/master/example1/lib/main.dart , search for the example named ex40LanguagesWithYOrdinalUserLabelsAndUserColors

mzimmerm commented 2 years ago

@Winghin2517 @moda20 Thanks for reporting this. Hopefully the snippet of code above helps with your problem, if it is still relevant. Also the latest version provides lots of examples

https://pub.dev/packages/flutter_charts

I will go ahead and close this, please feel free to reopen if you disagree. Thanks