|
WINDEX
|
Single trace to be plotted. More...
#include <plot2d.h>
Public Types | |
| enum class | eType { plot , realtime , scatter } |
Public Member Functions | |
| void | set (const std::vector< double > &y) |
| set plot data More... | |
| void | setScatterX (const std::vector< double > &x) |
| std::vector< double > | get () const |
| void | add (double y) |
| add new value to real time data More... | |
| void | add (double x, double y) |
| add point to scatter trace More... | |
| void | clear () |
| clear data from trace | |
| void | color (int clr) |
| set color | |
| int | color () const |
| void | thick (int t) |
| set trace thickness in pixels | |
| int | thick () const |
| int | size () const |
| get number of points | |
| double | value (double xfraction) |
| y value at fractional position along x-axis More... | |
| const std::vector< double > & | getY () |
Public Attributes | |
| enum wex::plot::trace::eType | myType |
Single trace to be plotted.
Application code should not attempt to construct a trace Rather call one of plot::AddPointTrace, plot::AddRealTimeTrace or plot::AddStaticTrace which return a reference to the trace which can be configured and be populated with data.
form fm;
construct plot to be drawn on form
plot::plot thePlot( fm );
construct plot trace
auto t1 = thePlot.AddStaticTrace();
provide some data for trace
std::vector< double > d1 { 10, 15, 20, 25, 30, 25, 20, 15, 10 };
t1.set( d1 );
plot in blue
t1.color( colors::blue );
show and run
fm.show();
exec();
|
inline |
add point to scatter trace
| [in] | x | location |
| [in] | y | location |
An exception is thrown when this is called for a trace that is not scatter type
|
inline |
add new value to real time data
| [in] | y | the new data point |
An exception is thrown when this is called for a trace that is not real time type.
|
inline |
set plot data
| [in] | y | vector of data points to display |
Replaces any existing data. Plot is NOT refreshed. An exception is thrown when this is called for a trace that is not plot or scatter type
|
inline |
y value at fractional position along x-axis
| [in] | xfraction | x-axis position 0 to 1 |