我正在使用 syncfusion_flutter_charts 包来显示图表,而那个表格视图太烦人了。如何删除它?或者如何使用自定义小部件制作这种图表?
-- | Provides access to the 2nd to last field of a tuple.
class AlmostLast s t a b | s -> a, t -> b, s b -> t, t a -> s where
_almostLast :: Lens s t a b
instance AlmostLast (a,b) (a',b) a a' where
_almostLast k ~(a,b) = k a <&> \a' -> (a',b)
{-# INLINE _almostLast #-}
instance AlmostLast (a,b,c) (a,b',c) b b' where
_almostLast k ~(a,b,c) = k b <&> \b' -> (a,b',c)
{-# INLINE _almostLast #-}
instance AlmostLast (a,b,c,d) (a,b,c',d) c c' where
_almostLast k ~(a,b,c,d) = k c <&> \c' -> (a,b,c',d)
{-# INLINE _almostLast #-}
答案 0 :(得分: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(),
),
],
),