File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -38,13 +38,10 @@ class _MyHomePageState extends State<MyHomePage> {
3838 height: 500 ,
3939 child: SfCartesianChart (
4040 borderWidth: 10 ,
41- primaryXAxis: CategoryAxis (),
42- primaryYAxis: NumericAxis (minimum: 20 ),
43- backgroundColor: Colors .white,
44- axisLabelFormatter: (AxisLabelRenderDetails args) {
45- late String text;
46- late TextStyle textStyle;
47- if (args.axisName == 'primaryXAxis' ) {
41+ primaryXAxis: CategoryAxis (
42+ axisLabelFormatter: (AxisLabelRenderDetails args) {
43+ late String text;
44+ late TextStyle textStyle;
4845 text = '${args .text }st\n Month' ;
4946 if (args.text == 'Jan' )
5047 textStyle =
@@ -59,12 +56,11 @@ class _MyHomePageState extends State<MyHomePage> {
5956 if (args.text == 'May' )
6057 textStyle =
6158 args.textStyle.copyWith (fontWeight: FontWeight .bold);
62- } else {
63- text = args.text;
64- textStyle = args.textStyle;
65- }
66- return ChartAxisLabel (text, textStyle);
67- },
59+ return ChartAxisLabel (text, textStyle);
60+ },
61+ ),
62+ primaryYAxis: NumericAxis (minimum: 20 ),
63+ backgroundColor: Colors .white,
6864 series: < ChartSeries <SalesData , String >> [
6965 LineSeries <SalesData , String >(
7066 dataSource: < SalesData > [
You can’t perform that action at this time.
0 commit comments