horizontalAlignment property
Aligns the annotations horizontally.
Alignment can be set to ChartAlignment.near
, ChartAlignment.far
, or
ChartAlignment.center
.
Defaults to ChartAlignment.center
Also refer ChartAlignment.
Widget build(BuildContext context) {
return Container(
child: SfCartesianChart(
annotations: <CartesianChartAnnotation>[
CartesianChartAnnotation(
widget: Container(
child: const Text('Annotation')),
x: 3,
y: 60,
horizontalAlignment: ChartAlignment.near
)
],
)
);
}
Implementation
final ChartAlignment horizontalAlignment;