mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
Added new type of chart view for double linear charts.
This commit is contained in:
parent
646390141a
commit
74313d23f3
4 changed files with 11 additions and 3 deletions
|
@ -17,6 +17,7 @@ struct Limits final {
|
||||||
enum class ChartViewType {
|
enum class ChartViewType {
|
||||||
Linear,
|
Linear,
|
||||||
Stack,
|
Stack,
|
||||||
|
DoubleLinear,
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Statistic
|
} // namespace Statistic
|
||||||
|
|
|
@ -16,11 +16,14 @@ namespace Statistic {
|
||||||
std::unique_ptr<AbstractChartView> CreateChartView(ChartViewType type) {
|
std::unique_ptr<AbstractChartView> CreateChartView(ChartViewType type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ChartViewType::Linear: {
|
case ChartViewType::Linear: {
|
||||||
return std::make_unique<LinearChartView>();
|
return std::make_unique<LinearChartView>(false);
|
||||||
} break;
|
} break;
|
||||||
case ChartViewType::Stack: {
|
case ChartViewType::Stack: {
|
||||||
return std::make_unique<StackChartView>();
|
return std::make_unique<StackChartView>();
|
||||||
} break;
|
} break;
|
||||||
|
case ChartViewType::DoubleLinear: {
|
||||||
|
return std::make_unique<LinearChartView>(true);
|
||||||
|
} break;
|
||||||
default: Unexpected("Type in Statistic::CreateChartView.");
|
default: Unexpected("Type in Statistic::CreateChartView.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,9 @@ void PaintChartLine(
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
LinearChartView::LinearChartView() = default;
|
LinearChartView::LinearChartView(bool isDouble)
|
||||||
|
: _isDouble(isDouble) {
|
||||||
|
}
|
||||||
|
|
||||||
LinearChartView::~LinearChartView() = default;
|
LinearChartView::~LinearChartView() = default;
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ struct Limits;
|
||||||
|
|
||||||
class LinearChartView final : public AbstractChartView {
|
class LinearChartView final : public AbstractChartView {
|
||||||
public:
|
public:
|
||||||
LinearChartView();
|
LinearChartView(bool isDouble);
|
||||||
~LinearChartView() override final;
|
~LinearChartView() override final;
|
||||||
|
|
||||||
void paint(
|
void paint(
|
||||||
|
@ -59,6 +59,8 @@ public:
|
||||||
void tick(crl::time now) override;
|
void tick(crl::time now) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
const bool _isDouble;
|
||||||
|
|
||||||
struct CacheToken final {
|
struct CacheToken final {
|
||||||
explicit CacheToken() = default;
|
explicit CacheToken() = default;
|
||||||
explicit CacheToken(
|
explicit CacheToken(
|
||||||
|
|
Loading…
Add table
Reference in a new issue