35 void setData(
const std::vector<float>& xValues,
const std::vector<float>& yValues);
61 void draw(uint32_t time)
override;
62 int getX()
const override;
63 int getY()
const override;
68 SDL_Renderer* renderer =
nullptr;
69 std::vector<float> xValues, yValues;
70 std::vector<SDL_Point> renderedPoints;
71 Rect geometry = { 0, 0, 0, 0 };
72 Color backgroundColor, lineColor;
void setYXMinMax(const Optional< std::pair< float, float >> &yMinMax)
Set the Y axis minimum and maximum. If unset, it will use the minimum and maximum from the dataset...
Definition: XYPlot.cpp:27
XYPlot()
Definition: XYPlot.cpp:3
The main application class header.
void setData(const std::vector< float > &xValues, const std::vector< float > &yValues)
Set the data points.
Definition: XYPlot.cpp:12
void setXMinMax(const Optional< std::pair< float, float >> &xMinMax)
Set the X axis minimum and maximum. If unset, it will use the minimum and maximum from the dataset...
Definition: XYPlot.cpp:21
void setLineColor(const Color lnColor)
Set the points color (it will also be used for the chart outline)
Definition: XYPlot.cpp:44
int getY() const override
Definition: XYPlot.cpp:77
void draw(uint32_t time) override
The draw method. It will be called once per frame for each object in a scene.
Definition: XYPlot.cpp:49
void setBackgroundColor(const Color bgColor)
Set the background color.
Definition: XYPlot.cpp:39
An abstract class implementing both the GraphicsObject and the TouchEnabledObject, which gives an interactive graphic object as result.
Definition: InteractiveGraphicsObject.h:20
int getWidth() const override
Definition: XYPlot.cpp:82
~XYPlot()
Definition: XYPlot.cpp:8
A class that wraps a value that can be null.
Definition: Optional.h:21
int getX() const override
Definition: XYPlot.cpp:72
A chart displaying X,Y points, scaled to the object geomtry.
Definition: XYPlot.h:25
int getHeight() const override
Definition: XYPlot.cpp:87
void setGeometry(Rect r)
Set the chart geometry (position and size)
Definition: XYPlot.cpp:33