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