2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Added initial animation and selection to stack chart view.

This commit is contained in:
23rd
2023-09-08 12:15:35 +03:00
committed by John Preston
parent 35ff45971f
commit b606a7b21d
4 changed files with 240 additions and 60 deletions

View File

@@ -706,7 +706,17 @@ void ChartWidget::ChartAnimationController::tick(
const auto footerMinFinished = isFinished(_animationValueFooterHeightMin);
const auto footerMaxFinished = isFinished(_animationValueFooterHeightMax);
chartView->tick(now);
// chartView->tick(now);
{
constexpr auto kDtHeightSpeed1 = 0.03 * 2;
constexpr auto kDtHeightSpeed2 = 0.03 * 2;
constexpr auto kDtHeightSpeed3 = 0.045 * 2;
if (_dtHeight.current.max > 0 && _dtHeight.current.max < 1) {
chartView->update(_dtHeight.current.max);
} else {
chartView->tick(now);
}
}
if (xFinished
&& yFinished
@@ -1262,7 +1272,8 @@ void ChartWidget::setupFilterButtons() {
void ChartWidget::setChartData(Data::StatisticalChart chartData) {
_chartData = std::move(chartData);
_chartView = CreateChartView(ChartViewType::Linear);
// _chartView = CreateChartView(ChartViewType::Linear);
_chartView = CreateChartView(ChartViewType::Stack);
setupDetails();
setupFilterButtons();