Signalsmith's Basic C++ Plots  1.1.0
A minimal C++ plotting library
Loading...
Searching...
No Matches
signalsmith::plot::Legend Class Reference

Inherits signalsmith::plot::SvgFileDrawable.

Methods

 Legend (SvgFileDrawable &ref, Bounds dataBounds, double rx, double ry)
 
void layout (const PlotStyle &style) override
 
Legendadd (PlotStyle::Counter style, std::string name, bool stroke=true, bool fill=false, bool marker=false)
 
Legendadd (const Line2D &line2D, std::string name, bool stroke=true, bool fill=false, bool marker=false)
 
Legendline (PlotStyle::Counter style, std::string name)
 
Legendline (const Line2D &line2D, std::string name)
 
Legendfill (PlotStyle::Counter style, std::string name)
 
Legendfill (const Line2D &line2D, std::string name)
 
Legendmarker (PlotStyle::Counter style, std::string name)
 
Legendmarker (const Line2D &line2D, std::string name)
 
void writeLabel (SvgWriter &svg, const PlotStyle &style) override
 
- Methods inherited from signalsmith::plot::SvgFileDrawable
void write (std::ostream &o, const PlotStyle &style)
 
void write (const std::string &svgFile, const PlotStyle &style)
 
void write (std::ostream &o)
 
void write (const std::string &svgFile)
 
ScheduledWrite writeLater (const std::string &svgFile)
 
- Methods inherited from signalsmith::plot::SvgDrawable
 SvgDrawable (const SvgDrawable &other)=delete
 
SvgDrawableoperator= (const SvgDrawable &other)=delete
 
Bounds layoutIfNeeded (const PlotStyle &style)
 
void addChild (SvgDrawable *child, bool front=false)
 Takes ownership of the child.
 
virtual void writeData (SvgWriter &svg, const PlotStyle &style)
 
virtual void toFrame (double time, bool clear=true)
 Creates a frame from the current stat, and optionally clears the state ready for the next frame.
 
virtual void loopFrame (double loopTime)
 Sets loop time (or < 0 to disable) for this element and all children.
 
virtual void clearFrames ()
 Removes all animation frames. Mostly useful if re-using the diagram for multiple animations.
 

Additional Inherited Members

- Protected Member Functions inherited from signalsmith::plot::SvgDrawable
void invalidateLayout ()
 
void addLayoutChild (SvgDrawable *child)
 These children are removed when the layout is invalidated.
 
- Protected Attributes inherited from signalsmith::plot::SvgDrawable
Bounds bounds
 

Method Details

◆ layout()

void signalsmith::plot::Legend::layout ( const PlotStyle & style)
inlineoverridevirtual

Reimplemented from signalsmith::plot::SvgDrawable.

◆ writeLabel()

void signalsmith::plot::Legend::writeLabel ( SvgWriter & svg,
const PlotStyle & style )
inlineoverridevirtual

Reimplemented from signalsmith::plot::SvgDrawable.