Is it possible to remove table from syncfusion_flutter_charts package?

Issue

Now: Now My goal: The my goal

I am using the syncfusion_flutter_charts package to display the chart and that table view is so annoying. How to remove that? or how to do this kind of chart using custom widgets?

// child of some widgets like container

 child: SfCartesianChart(
primaryXAxis: CategoryAxis(),
legend: Legend(isVisible: false),
tooltipBehavior: TooltipBehavior(enable: true),
series: <ChartSeries<_SalesData, String>>[
  LineSeries<_SalesData, String>(
      dataSource: data,
      xValueMapper: (_SalesData sales, _) =>sales.year.toString(),
      yValueMapper: (_SalesData sales, _) =>sales.value,
      ),
     ],
   ),

Solution

You can customize you chart, You can use this. I use map for test and date for example ({"val": 100, "year": 2000}), so you can use your favorite type, Set or anything else.
enter image description here

SfCartesianChart(
                        primaryXAxis: CategoryAxis(
                          isVisible: false,
                        ),
                        primaryYAxis: CategoryAxis(
                          isVisible: false,
                        ),
                        plotAreaBorderWidth: 0,
                        backgroundColor: Colors.grey[200],
                        legend: Legend(isVisible: false),
                        tooltipBehavior: TooltipBehavior(enable: true),
                        series: <ChartSeries<Map, String>>[
                          FastLineSeries<Map, String>(
                            width: 2,
                            dataSource: [{"val": 100, "year": 2000}, ...],
                            color: Colors.green,
                            yValueMapper: (Map sales, _) => sales['val'],
                            xValueMapper: (Map sales, _) => sales['year'].toString(),
                          ),
                        ],
                      ),

Answered By – Reza M

Answer Checked By – Timothy Miller (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *