Added new type of chart view for double linear charts.
This commit is contained in:
parent
646390141a
commit
74313d23f3
|
@ -17,6 +17,7 @@ struct Limits final {
|
|||
enum class ChartViewType {
|
||||
Linear,
|
||||
Stack,
|
||||
DoubleLinear,
|
||||
};
|
||||
|
||||
} // namespace Statistic
|
||||
|
|
|
@ -16,11 +16,14 @@ namespace Statistic {
|
|||
std::unique_ptr<AbstractChartView> CreateChartView(ChartViewType type) {
|
||||
switch (type) {
|
||||
case ChartViewType::Linear: {
|
||||
return std::make_unique<LinearChartView>();
|
||||
return std::make_unique<LinearChartView>(false);
|
||||
} break;
|
||||
case ChartViewType::Stack: {
|
||||
return std::make_unique<StackChartView>();
|
||||
} break;
|
||||
case ChartViewType::DoubleLinear: {
|
||||
return std::make_unique<LinearChartView>(true);
|
||||
} break;
|
||||
default: Unexpected("Type in Statistic::CreateChartView.");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,9 @@ void PaintChartLine(
|
|||
|
||||
} // namespace
|
||||
|
||||
LinearChartView::LinearChartView() = default;
|
||||
LinearChartView::LinearChartView(bool isDouble)
|
||||
: _isDouble(isDouble) {
|
||||
}
|
||||
|
||||
LinearChartView::~LinearChartView() = default;
|
||||
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue