fl_chart icon indicating copy to clipboard operation
fl_chart copied to clipboard

SideTitleWidget is missing

Open vidalbenjoe opened this issue 3 years ago • 3 comments

Describe the bug The method SideTitleWidget is missing or isn't defined.

To Reproduce In the bargraph example. Try to use the getTitles function

` Widget getTitles(double value, TitleMeta meta) { const style = TextStyle( color: Colors.white, fontWeight: FontWeight.bold, fontSize: 14, ); Widget text; switch (value.toInt()) { case 0: text = const Text('M', style: style); break; case 1: text = const Text('T', style: style); break; case 2: text = const Text('W', style: style); break; case 3: text = const Text('T', style: style); break; case 4: text = const Text('F', style: style); break; case 5: text = const Text('S', style: style); break; case 6: text = const Text('S', style: style); break; default: text = const Text('', style: style); break; } return SideTitleWidget( axisSide: meta.axisSide, space: 16, child: text, );

}`

Screenshots https://www.dropbox.com/s/23cet9n4eet0gmm/Screen%20Shot%202022-05-29%20at%2011.37.40%20AM.png?dl=0

Versions

  • Flutter version: 2.10.3
  • FLChart version: 0.50.6

vidalbenjoe avatar May 29 '22 03:05 vidalbenjoe

You need to run the master example in the master branch code. It seems you are using a stable version. You need to check our stable branch to use examples in your code.

imaNNeo avatar May 29 '22 14:05 imaNNeo

I have the same problem and i was following this https://github.com/imaNNeoFighT/fl_chart/blob/master/example/lib/line_chart/samples/line_chart_sample2.dart example

Version flutter: 2.16.2 FLChart: 0.50.6

mthobisig8 avatar May 29 '22 15:05 mthobisig8

You need to replace master with stable in your URL: https://github.com/imaNNeoFighT/fl_chart/blob/stable/example/lib/line_chart/samples/line_chart_sample2.dart

imaNNeo avatar May 29 '22 19:05 imaNNeo