-
Notifications
You must be signed in to change notification settings - Fork 774
Closed
Description
SfCartesianChart(
primaryXAxis: CategoryAxis(
isVisible: true,
//显示时间轴置顶
opposedPosition: false,
//时间轴反转
isInversed: false,
),
primaryYAxis: NumericAxis(
labelFormat: '{value}%',
axisLine: AxisLine(
width: 0,
color: Colors
.transparent),
majorTickLines:
MajorTickLines(
color: Colors
.transparent)),
//标题
// title: ChartTitle(text: '折线图测试'),
//选中类型
selectionType:
SelectionType.series,
//时间轴与值轴换位
isTransposed: false,
//选中手势
selectionGesture:
ActivationMode
.singleTap,
//图示
legend: Legend(
isVisible: true,
iconHeight: 10,
iconWidth: 10,
//切换系列显示
toggleSeriesVisibility:
true,
//图示显示位置
position: LegendPosition
.bottom,
overflowMode:
LegendItemOverflowMode
.wrap,
//图示左右位置
alignment:
ChartAlignment
.center),
//十字架
crosshairBehavior:
CrosshairBehavior(
lineType: CrosshairLineType
.horizontal, //横向选择指示器
enable: true,
shouldAlwaysShow:
false, //十字架始终显示(横向选择指示器)
activationMode:
ActivationMode
.singleTap,
),
//跟踪球
trackballBehavior:
TrackballBehavior(
lineType: TrackballLineType
.vertical, //纵向选择指示器
activationMode:
ActivationMode
.singleTap,
enable: true,
tooltipAlignment:
ChartAlignment
.near, //工具提示位置(顶部)
shouldAlwaysShow:
true, //跟踪球始终显示(纵向选择指示器)
tooltipDisplayMode:
TrackballDisplayMode
.groupAllPoints, //工具提示模式(全部分组)
),
//打开工具提示
tooltipBehavior:
TooltipBehavior(
enable: true,
shared: true,
activationMode:
ActivationMode
.singleTap,
),
//SplineSeries为曲线 LineSeries为折线ChartSeries
series: <
ChartSeries<SalesData,
String>>[
SplineSeries<SalesData,
String>(
name: '已开',
dataSource:
attendanceweeklista,
xValueMapper:
(SalesData sales,
_) =>
sales.year,
yValueMapper:
(SalesData sales,
_) =>
sales.sales,
color: Color(
0xff3794F1), // 曲线 颜色设置
//显示数据标签
dataLabelSettings:
DataLabelSettings(
isVisible: true,
alignment:
ChartAlignment
.near,
labelAlignment:
ChartDataLabelAlignment
.auto,
textStyle:
ChartTextStyle(
fontSize: 14,
),
),
//修饰数据点(显示圆圈)
markerSettings:
MarkerSettings(
isVisible:
true),
),
]),
Metadata
Metadata
Assignees
Labels
No labels