I want to create a crash game like this video:
So I use syncfusion_flutter_charts to add charts to my app as this way:
SfCartesianChart(
primaryXAxis: NumericAxis(),
primaryYAxis: NumericAxis(),
title: ChartTitle(text: chartData.length.toString()),
legend: Legend(isVisible: false),
series: <LineSeries<ChartSampleData, num>>[
LineSeries<ChartSampleData, num>(
dataSource: controller.chartData,
xValueMapper: (ChartSampleData data, _) =>
data.x / 100,
yValueMapper: (ChartSampleData data, _) =>
data.y / 100,
dataLabelSettings:
DataLabelSettings(isVisible: true)),
],
)
And use this code to generate data:
while (isStop == false) {
await Future.delayed(const Duration(seconds: 1));
this.x.value = this.x.value + 1;
y.value = x.value * x.value;
chartData.add(ChartSampleData(x: this.x.value, y: this.y.value));
}
My output of codes is this:
My question is how to add that spaceship to the end of the chart? Or can you have a better way to create that crash chart?

