【问题标题】:Is it possible to remove table from syncfusion_flutter_charts package?是否可以从 syncfusion_flutter_charts 包中删除表?
【发布时间】:2021-06-15 03:33:48
【问题描述】:

现在:我的目标:

我正在使用 syncfusion_flutter_charts 包来显示图表,而那个表格视图太烦人了。如何删除它?或者如何使用自定义小部件制作这种图表?

// 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,
      ),
     ],
   ),

【问题讨论】:

    标签: flutter flutter-packages


    【解决方案1】:

    您可以自定义图表,您可以使用它。我使用地图进行测试和日期,例如({"val": 100, "year": 2000}),所以你可以使用你最喜欢的类型,Set 或其他任何东西。

    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(),
                              ),
                            ],
                          ),
    

    【讨论】:

      猜你喜欢
      • 2010-10-10
      • 1970-01-01
      • 1970-01-01
      • 2017-08-19
      • 1970-01-01
      • 1970-01-01
      • 2016-06-03
      • 2017-10-13
      • 2011-04-15
      相关资源
      最近更新 更多