mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-09-09 21:44:15 +02:00
Fix stats values display.
This commit is contained in:
parent
52bb189996
commit
6afd4dcdd1
1 changed files with 10 additions and 7 deletions
|
@ -324,9 +324,8 @@ void PointDetailsWidget::setXIndex(int xIndex) {
|
||||||
nullptr,
|
nullptr,
|
||||||
{ float64(xIndex), float64(xIndex) }).parts
|
{ float64(xIndex), float64(xIndex) }).parts
|
||||||
: std::vector<PiePartData::Part>();
|
: std::vector<PiePartData::Part>();
|
||||||
const auto multiplier = float64(kOneStarInNano);
|
|
||||||
const auto isCredits
|
const auto isCredits
|
||||||
= _chartData.currency == Data::StatisticalCurrency::Credits;
|
= (_chartData.currency == Data::StatisticalCurrency::Credits);
|
||||||
for (auto i = 0; i < _chartData.lines.size(); i++) {
|
for (auto i = 0; i < _chartData.lines.size(); i++) {
|
||||||
const auto &dataLine = _chartData.lines[i];
|
const auto &dataLine = _chartData.lines[i];
|
||||||
auto textLine = Line();
|
auto textLine = Line();
|
||||||
|
@ -350,19 +349,23 @@ void PointDetailsWidget::setXIndex(int xIndex) {
|
||||||
? tr::lng_channel_earn_chart_overriden_detail_credits
|
? tr::lng_channel_earn_chart_overriden_detail_credits
|
||||||
: tr::lng_channel_earn_chart_overriden_detail_currency)(
|
: tr::lng_channel_earn_chart_overriden_detail_currency)(
|
||||||
tr::now));
|
tr::now));
|
||||||
|
const auto provided = dataLine.y[xIndex];
|
||||||
|
const auto value = isCredits
|
||||||
|
? CreditsAmount(provided, CreditsType::Stars)
|
||||||
|
: CreditsAmount(
|
||||||
|
provided / kOneStarInNano,
|
||||||
|
provided % kOneStarInNano,
|
||||||
|
CreditsType::Ton);
|
||||||
copy.value.setText(
|
copy.value.setText(
|
||||||
_textStyle,
|
_textStyle,
|
||||||
Lang::FormatExactCountDecimal(
|
Lang::FormatCreditsAmountDecimal(value));
|
||||||
dataLine.y[xIndex] / multiplier));
|
|
||||||
_lines.push_back(std::move(copy));
|
_lines.push_back(std::move(copy));
|
||||||
textLine.name.setText(
|
textLine.name.setText(
|
||||||
_textStyle,
|
_textStyle,
|
||||||
tr::lng_channel_earn_chart_overriden_detail_usd(tr::now));
|
tr::lng_channel_earn_chart_overriden_detail_usd(tr::now));
|
||||||
textLine.value.setText(
|
textLine.value.setText(
|
||||||
_textStyle,
|
_textStyle,
|
||||||
Info::ChannelEarn::ToUsd(
|
Info::ChannelEarn::ToUsd(value, _chartData.currencyRate, 0));
|
||||||
dataLine.y[xIndex] / multiplier,
|
|
||||||
_chartData.currencyRate, 0));
|
|
||||||
}
|
}
|
||||||
_lines.push_back(std::move(textLine));
|
_lines.push_back(std::move(textLine));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue