Flutter Google Charts changing fontWeight of TextStyleSpec

Viewed 1577

I'm using the google charts library for my flutter app and I'm trying to customize the styling of my lables.

But how can I change the fontweight of a TextStyleSpec? the parameter fontWeight asks for a String, I tried providing Bold, bold, 500, w500 but none work.

2 Answers

Quickly searching through the source code of the charts_flutter library on Github shows that the fontWeight property of the TextStyleSpec is never used. I would assume the library does not truly support setting the font weight.

Are you using the correct syntax? The syntax for the fontweight parameter uses the FontWeight class to modify the text, i.e., the value of fontweight can be supplied using the FontWeight consts. For example, fontweight: FontWeight.bold fontweight: FontWeight.w800

Related