diff --git a/Telegram/SourceFiles/statistics/statistics_common.h b/Telegram/SourceFiles/statistics/statistics_common.h index 76a3300be3..9d0843d5f0 100644 --- a/Telegram/SourceFiles/statistics/statistics_common.h +++ b/Telegram/SourceFiles/statistics/statistics_common.h @@ -17,6 +17,7 @@ struct Limits final { enum class ChartViewType { Linear, Stack, + DoubleLinear, }; } // namespace Statistic diff --git a/Telegram/SourceFiles/statistics/view/chart_view_factory.cpp b/Telegram/SourceFiles/statistics/view/chart_view_factory.cpp index e9b9516bdf..f12e89ed10 100644 --- a/Telegram/SourceFiles/statistics/view/chart_view_factory.cpp +++ b/Telegram/SourceFiles/statistics/view/chart_view_factory.cpp @@ -16,11 +16,14 @@ namespace Statistic { std::unique_ptr CreateChartView(ChartViewType type) { switch (type) { case ChartViewType::Linear: { - return std::make_unique(); + return std::make_unique(false); } break; case ChartViewType::Stack: { return std::make_unique(); } break; + case ChartViewType::DoubleLinear: { + return std::make_unique(true); + } break; default: Unexpected("Type in Statistic::CreateChartView."); } } diff --git a/Telegram/SourceFiles/statistics/view/linear_chart_view.cpp b/Telegram/SourceFiles/statistics/view/linear_chart_view.cpp index fdad065c16..f8c5bc2bd5 100644 --- a/Telegram/SourceFiles/statistics/view/linear_chart_view.cpp +++ b/Telegram/SourceFiles/statistics/view/linear_chart_view.cpp @@ -55,7 +55,9 @@ void PaintChartLine( } // namespace -LinearChartView::LinearChartView() = default; +LinearChartView::LinearChartView(bool isDouble) +: _isDouble(isDouble) { +} LinearChartView::~LinearChartView() = default; diff --git a/Telegram/SourceFiles/statistics/view/linear_chart_view.h b/Telegram/SourceFiles/statistics/view/linear_chart_view.h index 0a4c40800b..54be49e358 100644 --- a/Telegram/SourceFiles/statistics/view/linear_chart_view.h +++ b/Telegram/SourceFiles/statistics/view/linear_chart_view.h @@ -20,7 +20,7 @@ struct Limits; class LinearChartView final : public AbstractChartView { public: - LinearChartView(); + LinearChartView(bool isDouble); ~LinearChartView() override final; void paint( @@ -59,6 +59,8 @@ public: void tick(crl::time now) override; private: + const bool _isDouble; + struct CacheToken final { explicit CacheToken() = default; explicit CacheToken(