15#include <egt/widget.h>
34 using DataArray = std::deque<std::pair<double, double>>;
38 bool add(
const double&
data,
const double& data1)
45 m_data.emplace_back(std::make_pair(
data, data1));
51 bool add(
const double&
data,
const std::string& data1)
58 m_sdata.emplace_back(std::make_pair(
data, data1));
122 using Widget::Widget;
138 box_major_ticks_coord = 2,
140 box_minor_ticks_coord = 3,
218 void label(
const std::string& xlabel,
const std::string& ylabel,
const std::string& title);
246 void title(
const std::string& title);
273 std::unique_ptr<detail::PlPlotImpl> m_impl;
316 void create_impl() override;
323 void line_width(const
int val);
330 int line_width() const;
356 void deserialize(
Serializer::Properties& props);
400 void create_impl() override;
426 void deserialize(
Serializer::Properties& props);
472 void create_impl() override;
497 BarChart(const
Rect& rect, std::unique_ptr<detail::PlPlotImpl>&& impl);
504 void deserialize(
Serializer::Properties& props);
587 void title(const std::
string& title);
592 EGT_NODISCARD std::
string title() const;
611 EGT_NODISCARD
size_t data_size() const;
625 void remove_data(uint32_t count);
639 void resize(const
Size& size) override;
649 std::unique_ptr<detail::PlPlotPieChart> m_impl;
653 void deserialize(
Serializer::Properties& props);
Vertical BarChart Widget is used for displaying a set of categorical data.
Definition chart.h:436
BarChart(const BarChart &)=delete
BarPattern
Bar pattern styles.
Definition chart.h:441
BarChart(Serializer::Properties &props)
Construct a Barchart.
Definition chart.h:460
BarChart & operator=(const BarChart &)=delete
BarChart(BarChart &&) noexcept=default
BarChart(const Rect &rect={})
Construct a BarChart with the specified size.
Abstract base chart class.
Definition chart.h:119
void remove_data(uint32_t count)
Remove data items from top in an array.
float bank() const
Get bank percent set beyond min and maximum values.
std::string xlabel() const
Get chart x-axis label.
void data(const ChartItemArray &data)
Set a new set of data to Chart.
void serialize(Serializer &serializer) const
Serialize the widget to the specified serializer.
void title(const std::string &title)
Set chart title.
void draw(Painter &painter, const Rect &rect) override
Draw the widget.
void deserialize(Serializer::Properties &props)
void grid_style(GridFlag flag)
Set the grid style.
void label(const std::string &xlabel, const std::string &ylabel, const std::string &title)
Set chart labels.
size_t data_size() const
Get the number of data points.
std::string ylabel() const
Get chart y-axis label.
void resize(const Size &size) override
Resize the Chart.
void grid_width(const int val)
Set grid width.
virtual void create_impl()=0
GridFlag grid_style() const
Get chart grid style.
void ylabel(const std::string &ylabel)
Set chart y-axis label.
void xlabel(const std::string &xlabel)
Set chart x-axis label.
std::string title() const
Get chart title.
ChartItemArray data() const
Get the data points set for Chart.
GridFlag
Flags used to control how a chart grid is drawn.
Definition chart.h:128
void clear()
Remove all data items.
int grid_width() const
Get chart grid width.
void bank(float bank)
Add a percent bank beyond the min and maximum values.
void add_data(const ChartItemArray &data)
Add data items to an existing array.
void data(StringDataArray &data)
Definition chart.h:69
EGT_NODISCARD bool IsStringArray() const
Definition chart.h:94
ChartItemArray()
Definition chart.h:31
bool add(const double &data, const std::string &data1)
Definition chart.h:51
std::deque< std::pair< double, std::string > > StringDataArray
Definition chart.h:36
std::deque< std::pair< double, double > > DataArray
Definition chart.h:34
DataArray get_data()
Definition chart.h:74
StringDataArray get_sdata() const
Definition chart.h:89
~ChartItemArray()=default
DataArray get_data() const
Definition chart.h:84
bool add(const double &data, const double &data1)
Definition chart.h:38
void data(DataArray &data)
Definition chart.h:64
void clear()
Definition chart.h:102
StringDataArray get_sdata()
Definition chart.h:79
Horizontal BarChart Widget is used for displaying a set of categorical data.
Definition chart.h:515
HorizontalBarChart & operator=(const HorizontalBarChart &)=delete
HorizontalBarChart(const Rect &rect={})
Construct a HorizontalBarChart with the specified size.
HorizontalBarChart(const HorizontalBarChart &)=delete
HorizontalBarChart(HorizontalBarChart &&) noexcept=default
HorizontalBarChart(Serializer::Properties &props, bool is_derived)
HorizontalBarChart(Serializer::Properties &props)
Construct a HorizontalBarchart.
Definition chart.h:530
LineChart Widget is used for displaying information as a series of data points.
Definition chart.h:283
LineChart(LineChart &&) noexcept=default
LineChart & operator=(const LineChart &)=delete
LineChart(const Rect &rect={})
Construct a LineChart with the specified size.
LineChart(Serializer::Properties &props)
Construct a Linechart.
Definition chart.h:306
LineChart(const LineChart &)=delete
LinePattern
Line style patterns.
Definition chart.h:288
@ dotted
Definition chart.h:290
@ dashes
Definition chart.h:291
Drawing interface for 2D graphics.
Definition painter.h:45
PieChart Widget is a circular statistical graphic, which is divided into slices to illustrate numeric...
Definition chart.h:556
PieChart(Serializer::Properties &props)
Construct a Piechart.
Definition chart.h:570
PieChart(const Rect &rect={})
Construct a PieChart with the specified size.
PieChart & operator=(const PieChart &)=delete
PieChart(const PieChart &)=delete
PieChart(PieChart &&) noexcept=default
PointChart Widget is used for displaying information as a series of data points.
Definition chart.h:366
PointType
Point styles.
Definition chart.h:371
@ circle
Definition chart.h:373
@ cross
Definition chart.h:374
PointChart(const PointChart &)=delete
PointChart(PointChart &&) noexcept=default
PointChart(const Rect &rect={})
Construct a PointChart with the specified size.
PointChart & operator=(const PointChart &)=delete
PointChart(Serializer::Properties &props)
Construct a Pointchart.
Definition chart.h:390
Abstract base serializer class.
Definition serialize.h:34
std::list< std::tuple< std::string, std::string, Serializer::Attributes > > Properties
Definition serialize.h:47
EGT framework namespace.
Definition animation.h:24