Added initial support of statistical charts in earn channel section.

This commit is contained in:
23rd
2024-03-26 05:49:31 +03:00
committed by John Preston
parent 393d9e9f1f
commit 9c52f245ac
14 changed files with 84 additions and 8 deletions
@@ -61,7 +61,7 @@ Data::StatisticalChart StatisticalChartFromJSON(const QByteArray &json) {
line.isHiddenOnStart = ranges::contains(hiddenLines, columnId);
line.y.resize(length);
for (auto i = 0; i < length; i++) {
const auto value = array.at(i + 1).toInt();
const auto value = array.at(i + 1).toInteger();
line.y[i] = value;
if (value > line.maxValue) {
line.maxValue = value;
@@ -132,6 +132,13 @@ Data::StatisticalChart StatisticalChartFromJSON(const QByteArray &json) {
result.weekFormat = tooltipFormat.contains(u"'week'"_q);
}
}
{
const auto tickFormatIt = root.constFind(u"yTickFormatter"_q);
if (tickFormatIt != root.constEnd()) {
const auto tickFormat = tickFormatIt->toString();
result.isCurrency = tickFormat.contains(u"TON"_q);
}
}
const auto colors = root.value(u"colors"_q).toObject();
const auto names = root.value(u"names"_q).toObject();