class PlotData : public Vector<Pointf>, public MoveableAndDeepCopyOption<PlotData>
Class representing a single set of data in Plot. It consist of XY data stored as Vector<Pointf>, visual properties (line color, width and pattern,symbol and visibility) and a title to be used in legend.
PlotData& SetColor(RGBA col)
Sets color of the line to col.
PlotData& Visible(bool vis)
Shows or hides the series.
PlotData& Invisible()
Same as Visible(false).
PlotData& SetDash(String pattern)
Sets dashing of the line to pattern.
PlotData& SetTitle(String str)
Sets the title of the series to str.
PlotData& SetThickness(double thickness)
Sets the width of the line to thickness pixels.
RGBA GetColor()const
Returns color of the line.
bool IsVisible()const
Returns current visibility status.
String GetDash()const
Returns current dashing pattern.
String GetTitle()const
Returns title.
double GetThickness()const
Returns current thickness.
PlotSymbol* GetSymbol()
Returns a pointer to the PlotSymbol currently used to draw data points.
PlotData& SetDefaults()
Sets all properties to default values (Solid blue line of thickness 1px, no symbol, no title).
PlotData& SetSymbol(String symbol,Sizef size,RGBA color=RGBAZero(),RGBA frame=RGBAZero(),double thickness=1)
PlotData& SetSymbol(String symbol)
PlotData& SetSymbol(PlotSymbol* symbol)
Sets symbol to use for drawing data points.
void AddXY(double x,double y)
Adds one XY pair at the end of the vector.
Image GetIcon()
Returns a 20x40 px preview of line and symbol style. Usually used in legend.
String ToString()const
Returns a string consisting of the title of the series and its visibility status.
PlotData()
Creates empty series, with all properties set to default. See SetDefaults().
PlotData(const PlotData& pd,int)
Deep copy constructor.
PlotData(const Vector<Pointf>& data,const char* name="")
Constructs PlotData out of a Vector<Pointf> and sets title to name.
PlotData(const Array<Pointf>& data,const char* name="")
Constructs PlotData out of a Array<Pointf> and sets title to name.
template <class T> PlotData(const Vector<T>& data,const char* name="")
Constructs PlotData out of a Vector of any type convertible to double. The values in Vector are used as Y values, indexes are used as X. Title is set to name.
template <class K, class T> PlotData(const VectorMap<K,T>& data,const char* name="")
Constructs PlotData out of a VectorMap of any types convertible to double. Title is set to name.
template <class K, class T> PlotData(const ArrayMap<K,T>& data,const char* name="")
Constructs PlotData out of a VectorMap of any types convertible to double. Title is set to name.
|