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

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

Closed
Winghin2517 opened this issue Jun 9, 2018 · 3 comments
Closed
Assignees

Comments

@Winghin2517
Copy link

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
Copy link

moda20 commented May 30, 2019

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

@mzimmerm
Copy link
Owner

@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 mzimmerm self-assigned this Dec 19, 2021
@mzimmerm
Copy link
Owner

@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

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