scatter 0.1.0
BarPlot.hpp
1/*
2 * Copyright (C) Tobias Löw (tobi.loew@protonmail.ch)
3 *
4 * This file is part of Scatter
5 *
6 * Scatter is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Scatter is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Scatter. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <scatter/plots/PlotBase.hpp>
23#include <vector>
24
25namespace scatter
26{
28 class Point;
29
34 class BarPlot : public PlotBase
35 {
36 public:
38 class Options;
39
40 public:
49 BarPlot(const std::string &label, const std::vector<Point> &points, const Options &options);
50
58 BarPlot(const std::string &label, const std::vector<Point> &points);
59
67 BarPlot(const std::vector<Point> &points, const Options &options);
68
73 virtual ~BarPlot();
74
81
89 void render(Renderer &renderer, const Transform &transform);
90
97
103 double getYmax();
104
105 private:
107 std::vector<Point> points_;
109 std::unique_ptr<Options> options_;
110
111 public:
113 typedef std::unique_ptr<BarPlot> Ptr;
114 };
115
116} // namespace scatter
[brief description]
Definition BarPlotOptions.hpp:34
[brief description]
Definition BarPlot.hpp:35
BarPlot(const std::string &label, const std::vector< Point > &points)
[brief description]
BarPlot(const std::vector< Point > &points, const Options &options)
constructor
BarPlot(const std::string &label, const std::vector< Point > &points, const Options &options)
[brief description]
void render(Renderer &renderer, const Transform &transform)
render the BarPlot
Options * options()
[brief description]
virtual ~BarPlot()
destructor
std::unique_ptr< BarPlot > Ptr
convenience typedef
Definition BarPlot.hpp:113
double getYmax()
[brief description]
Legend::Entry getLegendEntry()
create LegendEntry
[brief description]
Definition PlotBase.hpp:36
[brief description]
Definition Renderer.hpp:38
[brief description]
Definition Transform.hpp:36
[brief description]
Definition Legend.hpp:59