bug fixes
This commit is contained in:
parent
e865f15f70
commit
6e8fe074da
|
|
@ -108,8 +108,8 @@ class _StatisticDetailsState extends State<StatisticDetails> {
|
|||
),
|
||||
minX: 0,
|
||||
maxX: state.datas.length.toDouble() - 1,
|
||||
maxY: state.maxValue * 1.001,
|
||||
minY: state.minValue,
|
||||
maxY: state.maxValue * 1.02,
|
||||
minY: state.minValue! * 0.98,
|
||||
gridData: FlGridData(show: false),
|
||||
borderData: FlBorderData(show: false),
|
||||
titlesData: FlTitlesData(show: false),
|
||||
|
|
|
|||
|
|
@ -82,14 +82,6 @@ class StatisticDetailsState extends CoreProvier {
|
|||
}
|
||||
for (var i = 0; i < result.length; i++) {
|
||||
datas.add(Data.fromList(result[i]));
|
||||
final highest = _stringToDouble(datas.last.h);
|
||||
final lowest = _stringToDouble(datas.last.l);
|
||||
if (highest > maxValue) {
|
||||
maxValue = highest;
|
||||
}
|
||||
if (lowest < (minValue ?? _stringToDouble(datas.last.p))) {
|
||||
minValue = lowest;
|
||||
}
|
||||
}
|
||||
if (currentDateRangeId != 0 && currentDateRangeId != 1) {
|
||||
final grouped =
|
||||
|
|
@ -99,8 +91,8 @@ class StatisticDetailsState extends CoreProvier {
|
|||
datas.add(
|
||||
Data(
|
||||
p: _average(value),
|
||||
h: maxValue.toString(),
|
||||
l: minValue.toString(),
|
||||
h: '',
|
||||
l: '',
|
||||
d: '',
|
||||
dp: 0,
|
||||
dt: '',
|
||||
|
|
@ -112,6 +104,15 @@ class StatisticDetailsState extends CoreProvier {
|
|||
);
|
||||
});
|
||||
}
|
||||
for (var i = 0; i < datas.length; i++) {
|
||||
final current = _stringToDouble(datas[i].p);
|
||||
if (maxValue < current) {
|
||||
maxValue = current;
|
||||
}
|
||||
if (minValue == null || minValue! > current) {
|
||||
minValue = current;
|
||||
}
|
||||
}
|
||||
getRelatedContents();
|
||||
datas.replaceRange(0, datas.length, datas.reversed);
|
||||
chartState = AppState.idle;
|
||||
|
|
|
|||
Loading…
Reference in New Issue